public Method

Set.==(set)

Returns true if two sets are equal. The equality of each couple of elements is defined according to Object#eql?.

Source Code

# File set.rb, line 311
def ==(set)
  equal?(set) and return true

  set.is_a?(Set) && size == set.size or return false

  hash = @hash.dup
  set.all? { |o| hash.include?(o) }
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.