Created
July 27, 2011 12:51
-
-
Save serialhex/1109300 to your computer and use it in GitHub Desktop.
This file contains 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
# ... snip | |
NArray.class_eval do | |
def sign | |
a = [] | |
self.each do |x| | |
a << x.sign | |
end | |
a | |
end | |
def eql_items? other | |
raise(ArgumentError, "Argument is not an Array") unless other.kind_of? NArray | |
raise(ArgumentError, "Arrays dont' have the same number of elements") if self.size != other.size | |
output = [] | |
self.each_with_index do |x, i| | |
output[i] = x == other[i] | |
end | |
return output | |
end | |
end | |
# ... snip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment