Merge branch 'master' of github.com:mongodb/mongo-ruby-driver

This commit is contained in:
Mike Dirolf 2009-12-17 12:24:23 -05:00
commit 9e38ef4f8b

View File

@ -111,5 +111,23 @@ class OrderedHash < Hash
super super
@ordered_keys = [] @ordered_keys = []
end end
def hash
code = 17
each_pair do |key, value|
code = 37 * code + key.hash
code = 37 * code + value.hash
end
code
end
def eql?(o)
if o.instance_of? OrderedHash
self.hash == o.hash
else
false
end
end
end end
end end