Li Chen wrote: > Pat Maddox wrote: > > > >> Just to expand on David's point a little... >> >> Since everything is an object in Ruby, you have to be in SOME context >> relating to an object. Any time you call a method without an explicit >> receiver, the receiver defaults to self. So in that example you end >> up calling >> self.method1 >> >> which is fine, as you'd expect. >> > > One more question: in my previouse script what does self really refer > to? > > Thanks, > > Li > > Ask Ruby... ruby$ irb irb(main):001:0> self => main The outermost object in Ruby is an instance of Object that irb identifies as "main".