From: Charlie Bowman Date: 2006-05-26T21:32:28+09:00 Subject: Re: How to access a classes private method --=-hhcAFJ0mQSkf6D3rSrkK Content-Type: text/plain Content-Transfer-Encoding: 7bit Sorry, just realized that the subject said private method, I meant to say protected. On Fri, 2006-05-26 at 21:29 +0900, Charlie Bowman wrote: > I'm trying to call a classes protected method but I can't seem to get it > to work. Here's an example of the method I'm trying to call > > moule Foo > Class Bar > protected > def bars_method(a=2) > a > end > end > end > > Here's what the relevant parts of my script look like > > def calling_protected_method > result = Foo::Bar.bars_method > end > > > This is resulting in a method not found error. I know I can't access a > protected method this way, but I don't know how to open up the class and > access this method. Thanks in advance for any help. > > > > > Charlie Bowman > http://www.recentrambles.com Charlie Bowman Programmer Castle Branch Inc. --=-hhcAFJ0mQSkf6D3rSrkK--