From: Dave Thomas Date: 2000-12-19T04:05:50+09:00 Subject: [ruby-talk:7594] Re: Question about #append_features "Christoph Rippel" writes: > Hi, > > This snippet is from singleton.rb ... > > module Singleton > def Singleton.append_features(klass) > klass.private_class_method(:new) > klass.instance_eval %{ > # ... > } > end > end > > How does #append_features work ? (it does not show > in L.to_a for a regular module L) It's described briefly at http://www.rubycentral.com/ref/ref_c_module.html#append_features It's the method called when you say 'include'. In this case, Singleton is hooking itself, so that when it gets included in a class it can work its magic. Regards Dave