From: Paolino Date: 2005-09-28T19:52:19+09:00 Subject: Re: Object private methods Robert Klemme wrote: > Paolino wrote: > >>Hello >> >> I noticed that Object private methods are available everywhere. >>This I noticed exploring 'main' instance defining a method >> >>Can I have some explanation on this form of globalizing ? > > > Dunno what exactly you are looking for... > > Typically these methods reside in Kernel and are defined like this: > > module Kernel > private > def foo() "something" end > end > > This works since all objects eventually inherit Kernel: > > > What else do you want to know? > My question was about something different probably. But why/how private messages are not accepting a receiver ? Is this their actual definition? I suppose 'main' does some tricks when I define a method "there". It pushes it in Object private space. Am I defining it in its singleton? Where exactly I find myself in the "global" ?I see self.is_a? Class is false,so I suppose I'm not in the sigleton space. Am I inside a method definition (o_O) defining a nested method? Thanks for answers Paolino ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it