From: James Coglan Date: 2008-08-25T03:05:51+09:00 Subject: Re: RCR: instance_methods(ancestor) ------=_Part_91646_20141983.1219601401173 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > > > It would be nice if we could simply say: > > instance_methods(FooAncestor) You could monkey-patch, if you're into that sort of thing. This maintains the existing method signature while adding your desired behaviour: class Module method = instance_method :instance_methods define_method :instance_methods do |condition = true| return method.bind(self).call(condition) unless Module === condition anc = ancestors index = anc.index(condition) || -1 anc[0..index].inject([]) { |methods, ancestor| methods.concat(ancestor.instance_methods(false)) }.uniq end end ------=_Part_91646_20141983.1219601401173--