Skip to content

Instantly share code, notes, and snippets.

@nicolasblanco
Created December 27, 2012 14:57
Show Gist options
  • Select an option

  • Save nicolasblanco/4388901 to your computer and use it in GitHub Desktop.

Select an option

Save nicolasblanco/4388901 to your computer and use it in GitHub Desktop.
irb(main):001:0> class Point < Struct.new(:x, :y); end
=> nil
irb(main):002:0> p = Point.new(3, 6)
=> #<struct Point x=3, y=6>
irb(main):003:0> p.x
=> 3
irb(main):004:0> p.y
=> 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment