Feature #8164

Public/Private

Added by Anonymous about 1 year ago. Updated about 1 year ago.

[ruby-core:53727]
Status:Assigned
Priority:Normal
Assignee:Yukihiro Matsumoto
Category:core
Target version:Next Major

Description

History

#1 Updated by Eric Hodel about 1 year ago

  • Category set to core

=begin

If privateclassmethod is removed, how will the class method foo be set to private here:

class C
def self.foo() end
def foo() end

private :foo

end

=end

#2 Updated by Edward Chen about 1 year ago

"Stuff" the private() method to take the explicit options.
A possible solution would be:
private (:instance => [], :class => [:foo])

In this way, although it adds a bit of complexity to the private and public methods, we would have reduced the method count of Module by 2 and simplified a class view => I can see all the public, private methods at a glance.

#3 Updated by Eric Hodel about 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Yukihiro Matsumoto
  • Target version set to Next Major

#4 Updated by Nobuyoshi Nakada about 1 year ago

Class methods and instance methods are different things.
I don't see advantages of this proposal.

Also available in: Atom PDF