Forum: Ruby Object private methods

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.
Ves P. (Guest)
on 2008-12-01 22:54
Consider the following,


class X
end

X.private_methods == Object.private_methods. Since X implicitly extends
Object, then how does X inherit Object's private methods, since the
documentation states that Subclasses inherit non-private methods only?

TIA,
ves
Robert D. (Guest)
on 2008-12-01 23:32
(Received via mailing list)
On Mon, Dec 1, 2008 at 9:48 PM, Ves P. <removed_email_address@domain.invalid>
wrote:
> Consider the following,
>
>
> class X
> end
>
> X.private_methods == Object.private_methods. Since X implicitly extends
> Object, then how does X inherit Object's private methods, since the
> documentation states that Subclasses inherit non-private methods only?
Does it? Any pointers? Well it is clearly incorrect.

Cheers
R.
This topic is locked and can not be replied to.