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
1 changed files with 18 additions and 0 deletions

View File

@ -111,5 +111,23 @@ class OrderedHash < Hash
super
@ordered_keys = []
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