From: dblack@... Date: 2006-03-21T05:01:36+09:00 Subject: Re: once again looking for my module methods Hi -- On Tue, 21 Mar 2006, Ross Bamford wrote: > On Mon, 2006-03-20 at 22:03 +0900, Trans wrote: >> Gee. Once again I want my module methods inherited. > > As usual, I have a feeling the answer is 'no', but doesn't this take > care of it (maybe with improved ignorance of callback methods)? > > module Foo > def self.included(c) > singleton_methods.reject { |e| e == 'included' }.each do |m| > mod = self > c.class_eval do > (class << self; self; end).class_eval do Is there any reason not to just do that as: (class << c; self; end).class_eval ? (I'm not sure whether there's some other hidden snag or not, as, per your original question, but that leapt out at me.) David -- David A. Black (dblack@wobblini.net) Ruby Power and Light, LLC (http://www.rubypowerandlight.com) "Ruby for Rails" chapters now available from Manning Early Access Program! http://www.manning.com/books/black