Skip to content

Ruby Docs: Autogenerated docs incorrectly list class methods as instance method #1885

Open
@fallwith

Description

Owing to the fact that our NewRelic::Agent class (lib/new_relic/agent.rb) utilizes the extend self pragma to define class methods without using def self.*, our autogenerated RDoc content incorrectly ends up referring to class methods as instance methods.

For example, for NewRelic::Agent.set_transaction_name...

Incorrect
This page: https://rubydoc.info/github/newrelic/newrelic-ruby-agent/NewRelic/Agent#set_transaction_name-instance_method

  • Incorrectly has "instance_method" in the URL
  • Incorrectly refers to the method as an instance method (uses #) instead of a class method (uses .).

Correct
This page: https://docs.newrelic.com/docs/apm/agents/ruby-agent/api-guides/ruby-custom-instrumentation/#naming-transactions

  • Is manually generated
  • Correctly refers to the method as a class method

In order to get the autogenerated docs to correctly recognize methods as class methods, we'll likely need to do one or more of the following:

  • Refactor our Ruby code to be more compatible
  • Update the annotated source code comments syntax that we use for each public method if there's a way to specify that a method is a class method
  • Update the autogeneration process
  • Manually put the autogenerated content through a filter that updates the content

Acceptance criteria: All autogenerated RDoc content matches the already-correct manually created documentation.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions