From: Robert Klemme Date: 2008-03-07T02:49:54+09:00 Subject: Re: Ruby Basics / define met;hod On 06.03.2008 17:18, Chinna Karuppan wrote: > I did read through your reply.especially this.... > "Inside a class body /self/ is the class instance being defined right > now." > I still could not understand. You wondered why define_method can be invoked inside class...end because it is private and should not be accessible "from outside". Private methods can normally be only invoked without an explicit receiver, i.e. only on /self/. I explained and demonstrated (via the printing) that inside class...end /self/ is actually the class being defined. Hence you can invoke define_method inside class..end. q.e.d. Then I went on to explain that /private/ in Ruby is rather weak because you can invoke private methods on any instance simply by going through /send/. Cheers robert