Yukihiro Matsumoto
3/23/2007 8:40:00 AM
Hi,
In message "Re: About class methods visibility (public/private)"
on Fri, 23 Mar 2007 02:34:51 +0900, Ruby Admirer <ruby_admirer@yahoo.com> writes:
|In my opinion, class_private, class_public, and class_protected names have the following benefits :
|- they are very close to the private, public and protected methods.
|- they cover one or multiple arguments
|
|But similar names will also be great !
In my opinion, if you want to change the visibility, you'd better to
use singleton class notation, for class methods are singleton methods
for class objects after all.
class Foo
class <<Foo
# class method foo
def foo
end
# visibility private
private :foo
end
# instance method foo
def foo
end
# visibility private
private :foo
end
There's no need for new methods. private_class_method and others are
utility method for people who really love the term 'class methods'.
matz.