Created
January 26, 2014 07:32
-
-
Save RPGP1/8629702 to your computer and use it in GitHub Desktop.
Array#===は要素を===で判定してくれ!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def ===(other) | |
return false if self.size != other.size | |
self.each_with_index do |value, index| | |
return false unless value === other[index] | |
end | |
return true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment