3

I'm writing a gem for ActiveRecord that provides a Concern. One of them installs a singleton method (aka class method), and I want to document it with rdoc. After reading the rdoc documentation, I hoped this would work:

module MyModule
  extend ActiveSupport::Concern

  class_methods do
    ##
    # :singleton-method:
    # This method does something useful.

    def my_class_method(*template_columns, **options)
      # ...
    end
  end
end

but rdoc seems to be ignoring :singleton-method: and just treating it as a comment, with my_class_method being incorrectly placed in the "Instance Public Methods" section.

How can I oblige rdoc to place this method in the class methods section of the documentation?

(Yard is also a problem - it seems to ignore the class_methods section entirely)

inopinatus
  • 3,597
  • 1
  • 26
  • 38

0 Answers0