Method: Weak::Set#freeze
- Defined in:
- lib/weak/set.rb
permalink #freeze ⇒ self
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.
469 470 471 472 |
# File 'lib/weak/set.rb', line 469 def freeze warn("Can't freeze #{self.class}") self end |