From: Adam Prescott Date: 2011-11-23T23:33:48+09:00 Subject: Re: private and protected --14dae93996c7b36e5304b267cedf Content-Type: text/plain; charset=UTF-8 On Wed, Nov 23, 2011 at 14:08, Peter Hickman wrote: > The call 'self.phrase' is a call to a class method but 'def phrase' is > the definition of an instance method. Either remove the self in the > say method or change 'def phrase' to 'def self.phrase'. > > It has nothing to do with private or protected. > This isn't correct, it has everything to do with private or protected! The methods and method calls in the example are all instance methods, not class methods. self.class.phrase would be a class method call. As Daniel has said, the "problem" is that private methods may not be called with an explicit receiver. --14dae93996c7b36e5304b267cedf--