class OrConstraint < Constraint attr_accessor :constraints def initialize(constraints) @constraints = constraints.compact.uniq end def to_s "Or<#{@constraints.collect {|c| c.inspect }.join(", ")}>" end def inspect to_s end def eql?(b) return false if !b.is_a?(OrConstraint) a = Set.new(@constraints) b = Set.new(b.constraints) return false if a.size != b.size a.each do |x| ret = false b.each do |y| if x.eql?(y) ret = true break end end return false if !ret end return true end end