Skip to content

Instantly share code, notes, and snippets.

@tpendragon
Created October 30, 2015 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpendragon/1d1407e474292acdf35b to your computer and use it in GitHub Desktop.
Save tpendragon/1d1407e474292acdf35b to your computer and use it in GitHub Desktop.
irb(main):001:0> class TestHash
irb(main):002:1> def hash
irb(main):003:2> 1
irb(main):004:2> end
irb(main):005:1> end
=> :hash
irb(main):006:0> b = {}
=> {}
irb(main):007:0> c = TestHash.new
=> #<TestHash:0x007f817a1cc4f8>
irb(main):008:0> d = TestHash.new
=> #<TestHash:0x007f817a1b6cc0>
irb(main):009:0> b[c] = "1"
=> "1"
irb(main):010:0> b[d] = "2"
=> "2"
irb(main):011:0> b
=> {#<TestHash:0x007f817a1cc4f8>=>"1", #<TestHash:0x007f817a1b6cc0>=>"2"}
irb(main):012:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment