Skip to content

Instantly share code, notes, and snippets.

@shellac
Created March 3, 2010 10:48
Show Gist options
  • Save shellac/320519 to your computer and use it in GitHub Desktop.
Save shellac/320519 to your computer and use it in GitHub Desktop.
require 'java'
class Java::JavaLang::Object
def inspect()
fs = self.java_class.declared_fields
val = "#<#{self.class}: "
fs.each { |f| f.accessible=true; val += "@#{f.name} = #{f.value(self)}, " }
val += ">"
val
end
end
#t = java.lang.String.new("test")
#t.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment