Suraj Kurapati wrote: > # recursively adds Logging functionality to all nested classes > extender = lambda do |k| > k.constants.map {|c| k.const_get c }. > select {|c| c.is_a? Class or c.is_a? Module }. Hmm, I should have used duck-typing in the above line (all the Java programming I've done recently has corrupted me ;-). So the above line should be written as: select {|c| c.respond_to? :constants and c.respond_to? :const_get }. > each do |c| > c.extend Logging > extender[c] > end > end -- Posted via http://www.ruby-forum.com/.