Multiton can be included in another module, in which case that module effectively becomes a multiton behavior distributor too. This is why we propogate # to the base module. by putting it in another module.
# File lib/more/facets/multiton.rb, line 189 189: def included(base) 190: class << base 191: #alias_method(:new!, :new) unless method_defined?(:new!) 192: # gracefully handle multiple inclusions of Multiton 193: unless include?(Multiton::MetaMethods) 194: alias_method :new!, :new 195: private :allocate #, :new 196: include Multiton::MetaMethods 197: 198: if method_defined?(:marshal_dump) 199: undef_method :marshal_dump 200: warn "warning: marshal_dump was undefined since it is incompatible with the Multiton pattern" 201: end 202: end 203: end 204: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.