From: Intransition Date: 2011-10-29T07:46:08+09:00 Subject: Re: Use #extend on BasicObject ? On Oct 28, 5:59 pm, Robert Klemme wrote: > On Fri, Oct 28, 2011 at 5:13 PM, Intransition wrote: > > > On Oct 28, 10:39 am, Robert Klemme wrote: > >> On Fri, Oct 28, 2011 at 3:40 PM, Intransition wrote: > > Thanks. Robert. You are a reliable work horse on this mailing list. > > The community owes you much kudo. > > Thank you! > > > I jumped the gun and put in a feature request on redmine. matz gave me > > the same answer. so you are in good company :-) > > :-) > > > However Nakada gave me a bit nicer one I think: > > >  Enumerable.__send__(:extend_object, BasicObject.new) > > > Using the module callback. pretty smart. > > Indeed!  Still it's more verbose than it should be, don't you think? > Making this method public seems like the idea solution.  Do you have > any insight / idea why it is private? Probably b/c normally you're not supposed to call it directly. You use object#extend(module) instead and then that dispatches to module.extend_object(object). In other words, it's private as form of deterrence from casual use.