What exactly is the method: a notation designed for ruby ​​documents?

Minitest has many methods defined as follows:

## # :method: must_equal # See MiniTest::Assertions#assert_equal ## # :method: must_include # See MiniTest::Assertions#assert_includes ## # :method: must_match # See MiniTest::Assertions#assert_match ## # :method: must_output # See MiniTest::Assertions#assert_output 

They are defined in the Object module, so they are available for all objects. But why do not they appear in any documents? I checked the documents created by Yard on rdoc.info , and the ones that rdoc generated when entering gem rdoc minitest . They do not appear either. How should I refer to them if they do not appear anywhere? What to do :method: :?

+4
source share
1 answer

This looks like a way to document a method that is not explicitly defined. There are times when you can add a note about a method that is dynamically generated, for example, or loaded from another module, as here.

0
source

All Articles