rdoc icon indicating copy to clipboard operation
rdoc copied to clipboard

rdoc 6.13.1 does not detect `private :new`

Open halostatue opened this issue 9 months ago • 0 comments

I'm not sure if this is a bug report or a feature request; I think it has worked in the past but I'm not sure.

Given an input foo.rb:

# Example Foo class should not document private new
class Foo
  class << self
    private :new
  end

  # This should not be documented
  def initialize(...)
  end
end

The generated documentation should not document the new class method.

Image

I can work around this by adding # :nodoc:, but it feels like something that should be detected by the parser.

I'm updating a gem to be Ruby 3.2+, so if there's a better way to mark a private new in those versions that rdoc does detect, I can use that instead.

halostatue avatar May 10 '25 15:05 halostatue