Created
October 21, 2011 16:13
-
-
Save TomTriple/1304235 to your computer and use it in GitHub Desktop.
java <-> jruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include Java | |
include_class "java.util.ArrayList" | |
list = ArrayList.new | |
block = Proc.new do | |
add "entry 1" | |
add "entry 2" | |
end | |
list.instance_eval &block | |
pp list.get(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment