Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Set#compare_by_identity
compare_by_identity
lib/set.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/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
Makes the set compare its elements by their identity and returns self. This method may not be supported by all subclasses of Set.