Method: Set#compare_by_identity

Defined in:
lib/set.rb

#compare_by_identityObject

Makes the set compare its elements by their identity and returns self. This method may not be supported by all subclasses of Set.



257
258
259
260
261
262
263
264
# File 'lib/set.rb', line 257

def compare_by_identity
  if @hash.respond_to?(:compare_by_identity)
    @hash.compare_by_identity
    self
  else
    raise NotImplementedError, "#{self.class.name}\##{__method__} is not implemented"
  end
end