Method: Set#==
- Defined in:
- lib/set.rb
#==(other) ⇒ Object
677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/set.rb', line 677 def ==(other) if self.equal?(other) true elsif other.instance_of?(self.class) @hash == other.instance_variable_get(:@hash) elsif other.is_a?(Set) && self.size == other.size other.all? { |o| @hash.include?(o) } else false end end |