Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2014 09:20
Show Gist options
  • Save anonymous/fae2335b2f74f61e5ee7 to your computer and use it in GitHub Desktop.
Save anonymous/fae2335b2f74f61e5ee7 to your computer and use it in GitHub Desktop.
[1] pry(main)> class MyThing
[1] pry(main)* def thingy
[1] pry(main)* @@thingy = Struct.new(:key_one, :key_two)
[1] pry(main)* @@thingy.new(key_one = 'stuff', key_two = 'more_stuff')
[1] pry(main)* end
[1] pry(main)* end
=> :thingy
[2] pry(main)> def example_thing
[2] pry(main)* t = MyThing.new
[2] pry(main)* t.thingy
[2] pry(main)* end
=> :example_thing
[3] pry(main)> example_thing
=> #<struct key_one="stuff", key_two="more_stuff">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment