Created
January 21, 2010 02:47
-
-
Save slyphon/282530 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
class IHazName | |
def initialize(name) | |
@name = name | |
end | |
end | |
zero = IHazName.new('zero') | |
one = IHazName.new('one') | |
monkey_nuts = IHazName.new('three') | |
array = [zero, one, monkey_nuts] | |
puts "array looks like: #{array.inspect}" | |
puts "item 0 is: #{array[0]}" | |
puts "item 1 is: #{array[1]}" | |
puts "item 2 is: #{array[2]}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment