Method: Weak::Set#freeze

Defined in:
lib/weak/set.rb

#freezeself

Weak::Set objects can’t be frozen since this is not enforced by the underlying ‘ObjectSpace::WeakMap` implementation. Thus, we try to signal this by not actually setting the `frozen?` flag and ignoring attempts to freeze us with just a warning.

Returns:

  • (self)
[View source]

469
470
471
472
# File 'lib/weak/set.rb', line 469

def freeze
  warn("Can't freeze #{self.class}")
  self
end