Sha256: 5afa4b2b26fe68cee469e59282a0fb7fcba1cbb0b260979997ff072a15e844ec

Contents?: true

Size: 389 Bytes

Versions: 18

Compression:

Stored size: 389 Bytes

Contents

# extracted from from http://replay.waybackmachine.org/20090311014545/http://blog.playlouder.com/2008/05/07/an-interesting-ruby-hash-semantics-gotcha/

# also see http://kpumuk.info/ruby-on-rails/memo-5-use-ary-uniq-method-carefully-in-ruby 

if RUBY_VERSION < '1.8.7'


class Hash
 def hash
   inject(0) {|hash,pair| hash ^ pair.hash}
 end

 def eql?(other)
   self == other
 end
end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
sane-0.25.8 lib/sane/hash_hashes.rb
sane-0.25.7 lib/sane/hash_hashes.rb
sane-0.25.6 lib/sane/hash_hashes.rb
sane-0.25.5 lib/sane/hash_hashes.rb
sane-0.25.4 lib/sane/hash_hashes.rb
sane-0.25.3 lib/sane/hash_hashes.rb
sane-0.25.2 lib/sane/hash_hashes.rb
sane-0.25.1 lib/sane/hash_hashes.rb
sane-0.25.0 lib/sane/hash_hashes.rb
sane-0.24.6 lib/sane/hash_hashes.rb
sane-0.24.5 lib/sane/hash_hashes.rb
sane-0.24.4 lib/sane/hash_hashes.rb
sane-0.24.3 lib/sane/hash_hashes.rb
sane-0.23.6 lib/sane/hash_hashes.rb
sane-0.24.2 lib/sane/hash_hashes.rb
sane-0.24.1 lib/sane/hash_hashes.rb
sane-0.24.0 lib/sane/hash_hashes.rb
sane-0.23.5 lib/sane/hash_hashes.rb