1 parent 28ab106 commit b8ab6afCopy full SHA for b8ab6af
1 file changed
mrblib/hash.rb
@@ -12,7 +12,11 @@ class Hash
12
# ISO 15.2.13.4.1
13
def == (hash)
14
return true if self.equal?(hash)
15
- hash = hash.to_hash
+ begin
16
+ hash = hash.to_hash
17
+ rescue NoMethodError
18
+ return false
19
+ end
20
return false if self.size != hash.size
21
self.each do |k,v|
22
return false unless hash.key?(k)
@@ -28,7 +32,11 @@ def == (hash)
28
32
# ISO 15.2.13.4.32 (x)
29
33
def eql?(hash)
30
34
31
35
36
37
38
39
40
41
42
0 commit comments