that make four (times of identical == definitions)
This commit is contained in:
parent
52ca7110c3
commit
8ff55fdb1f
@ -15,9 +15,17 @@ module Virtual
|
|||||||
# simple thought: don't recurse for Blocks, just check their names
|
# simple thought: don't recurse for Blocks, just check their names
|
||||||
def == other
|
def == other
|
||||||
return false unless other.class == self.class
|
return false unless other.class == self.class
|
||||||
attributes.each do |a|
|
Sof::Util.attributes(self).each do |a|
|
||||||
left = send(a)
|
begin
|
||||||
right = other.send(a)
|
left = send(a)
|
||||||
|
rescue NoMethodError
|
||||||
|
next # not using instance variables that are not defined as attr_readers for equality
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
right = other.send(a)
|
||||||
|
rescue NoMethodError
|
||||||
|
return false
|
||||||
|
end
|
||||||
return false unless left.class == right.class
|
return false unless left.class == right.class
|
||||||
if( left.is_a? Block)
|
if( left.is_a? Block)
|
||||||
return false unless left.name == right.name
|
return false unless left.name == right.name
|
||||||
|
@ -6,9 +6,17 @@ module Virtual
|
|||||||
class Type
|
class Type
|
||||||
def == other
|
def == other
|
||||||
return false unless other.class == self.class
|
return false unless other.class == self.class
|
||||||
attributes.each do |a|
|
Sof::Util.attributes(self).each do |a|
|
||||||
left = send(a)
|
begin
|
||||||
right = other.send(a)
|
left = send(a)
|
||||||
|
rescue NoMethodError
|
||||||
|
next # not using instance variables that are not defined as attr_readers for equality
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
right = other.send(a)
|
||||||
|
rescue NoMethodError
|
||||||
|
return false
|
||||||
|
end
|
||||||
return false unless left.class == right.class
|
return false unless left.class == right.class
|
||||||
return false unless left == right
|
return false unless left == right
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user