Skip to content

Instantly share code, notes, and snippets.

@halorgium
Created October 2, 2008 05:39
Show Gist options
  • Save halorgium/14287 to your computer and use it in GitHub Desktop.
Save halorgium/14287 to your computer and use it in GitHub Desktop.
>> a = "foo"
=> "foo"
>> b = "bar"
=> "bar"
>> c = {}
=> {}
>> c[a] ||= :foo
=> :foo
>> c[b] ||= :bar
=> :bar
>> c
=> {"foo"=>:foo, "bar"=>:bar}
>> a.hash
=> 876516207
>> def a.hash; :zozozoz.hash; end
=> nil
>> def b.hash; :zozozoz.hash; end
=> nil
>> c = {}
=> {}
>> c[a] ||= :foo
=> :foo
>> c[b] ||= :bar
=> :bar
>> c
=> {"foo"=>:foo, "bar"=>:bar}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment