Forum: Ruby (no subject)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Charlie B. (Guest)
on 2006-05-26 17:10
(Received via mailing list)
-------- Forwarded Message --------
From: Charlie B. <removed_email_address@domain.invalid>
Subject: Re: How to access a classes private method
Date: Fri, 26 May 2006 09:07:04 -0400

I'm trying to modify someone else's class.  I am not the creator of
Foo::Bar, I just want to use their methods.  This is actually for a
rails plugin I'm developing.

>
> If you need to access it outside of an instance, why make it protected?
> How are you using this?
>
> Anyway, onto the solution:
>
>   def calling_protected_method
>     result = Foo::Bar.new.method(:bars_method).call
>   end
>

Charlie B.
Programmer
Castle Branch Inc.
Charlie B.
Programmer
Castle Branch Inc.
Re:
Charlie B. (Guest)
on 2006-05-26 17:13
(Received via mailing list)
I forgot to say thanks.

Thanks!
This topic is locked and can not be replied to.