Permalink
Browse files

Use Array#== to test fieldwise equality

  • Loading branch information...
1 parent 5314661 commit 3571ce46065ab12fac5051f0892c828633e79559 @tomstuart tomstuart committed Feb 17, 2013
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/values.rb
View
@@ -29,9 +29,7 @@ def ==(other)
def eql?(other)
return false if other.class != self.class
- self.class::VALUE_ATTRS.all? do |field|
- self.send(field) == other.send(field)
- end
+ self.class::VALUE_ATTRS.map { |field| send(field) } == self.class::VALUE_ATTRS.map { |field| other.send(field) }
end
def hash

0 comments on commit 3571ce4

Please sign in to comment.