Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4609

is it possible to generate documentation for anonymous classes in rdoc

$
0
0

I would like to document a few methods in an anonymous class for rdoc.

I know that alternative documetation tool exists, such as yard, but not sure the project owners are ready for change they inventory for sake of few methods.

I tried use :method: directive, but no luck so far

Tried with ruby 2.7, rdoc 6.3

# (c) 2024 Big Corporation# = ExampleModule gives a great example## This module contains an example of documenting an anonymous class created with Class.new.module ExampleModule  # Create an anonymous class using Class.new, almost the same as  #   class AnonymousClass  # and give a closure  # but fails rdoc  AnonymousClass = Class.new do    ##    # :method: initialize    def initialize(param1, param2)      # ... initialization code ...    end    ##    # :method: example_method    # == example_method    #    # An example method in the anonymous class.    def example_method      # ... method implementation ...    end  endend

Viewing all articles
Browse latest Browse all 4609

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>