Very similar to #2653 and how we handle private constants. We need to start taking private_class_method into consideration in the indexer.
When not using the class << self syntax, the private method has no impact whatsoever on the visibility of methods and the only way to mark them as private is by invoking private_class_method.
class Foo
private
# this method is public
def self.bar
end
# this makes it private
private_class_method(:bar)
end
Essentially, we need to:
- Add a new branch here to handle the
private_class_method
- Grab the entry that was already inserted in the index for that method and owner combination
- Mark the method as private
Very similar to #2653 and how we handle private constants. We need to start taking
private_class_methodinto consideration in the indexer.When not using the
class << selfsyntax, theprivatemethod has no impact whatsoever on the visibility of methods and the only way to mark them as private is by invokingprivate_class_method.Essentially, we need to:
private_class_method