Method: NameMagic::ClassMethods#__forget__
- Defined in:
- lib/y_support/name_magic/class_methods.rb
#__forget__(instance) ⇒ Object
De-registers an instance without performing #const_magic first. The argument must be a registered instance, or TypeError ensues. Returns instance name for forgotten named instances, nil for forgotten nameless instances.
99 100 101 102 103 104 |
# File 'lib/y_support/name_magic/class_methods.rb', line 99 def __forget__ instance fail TypeError, "Supplied argument is not an instance " + "of #{self}!" unless instance.is_a? self return super if namespace == self namespace.__forget__ instance end |