Skip to content

Instantly share code, notes, and snippets.

@slyphon
Created January 21, 2010 02:47
Show Gist options
  • Save slyphon/282530 to your computer and use it in GitHub Desktop.
Save slyphon/282530 to your computer and use it in GitHub Desktop.
#!/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