Skip to content

Instantly share code, notes, and snippets.

@benaskins
Created February 16, 2010 06:05
Show Gist options
  • Save benaskins/305328 to your computer and use it in GitHub Desktop.
Save benaskins/305328 to your computer and use it in GitHub Desktop.
~/Development/client_projects/thinkbank (master)$ irb
irb(main):001:0> my_klass = Struct.new(:x, :y)
=> #<Class:0x11605ac>
irb(main):003:0> my_object = my_klass.new(1, 2)
=> #<struct #<Class:0x11605ac> x=1, y=2>
irb(main):004:0> irb my_object
irb#1(#<struct #<Class:0x11605ac> x=1, y=2>):001:0> x
=> 1
irb#1(#<struct #<Class:0x11605ac> x=1, y=2>):002:0> y
=> 2
irb#1(#<struct #<Class:0x11605ac> x=1, y=2>):003:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment