Skip to content

Instantly share code, notes, and snippets.

@jruby
Created December 16, 2009 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jruby/257634 to your computer and use it in GitHub Desktop.
Save jruby/257634 to your computer and use it in GitHub Desktop.
~/projects/jruby ➔ jruby -J-Djruby.ji.newStyleExtension=true impl.rb
class Foo_2071503186
class org.jruby.RubyObject
class Foo2_2071503278
class java.lang.Object
~/projects/jruby ➔ cat impl.rb
require 'java'
require 'jruby'
class Foo
include java.lang.Runnable
end
f = Foo.new
# inspect the object from the Java side of the world
ref = JRuby.reference(f)
puts ref.getClass
puts ref.getClass.getSuperclass
class Foo2 < java.lang.Object
include java.lang.Runnable
end
f2 = Foo2.new
# inspect again
ref = JRuby.reference(f2)
puts ref.getClass
puts ref.getClass.getSuperclass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment