Created
November 30, 2010 22:43
-
-
Save cowboyd/722571 to your computer and use it in GitHub Desktop.
convert native java arraylist to ruby array.
This file contains 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
require 'java' | |
list = java.util.ArrayList.new | |
list.add(1) | |
list.add(2) | |
puts list.inspect #=> <Java::JavaUtil::ArrayList:0x7dc21ece> | |
puts list.to_a.inspect #=> [1, 2] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment