Method: YARD::CodeObjects::Base#docstring=

Defined in:
lib/yard/code_objects/base.rb

#docstring=(comments) ⇒ Object

Attaches a docstring to a code object by parsing the comments attached to the statement and filling the #tags and #docstring methods with the parsed information.

Parameters:

  • comments (String, Array<String>, Docstring)

    the comments attached to the code object to be parsed into a docstring and meta tags.

[View source]

427
428
429
430
431
# File 'lib/yard/code_objects/base.rb', line 427

def docstring=(comments)
  @docstrings.clear
  @docstring = Docstring === comments ?
    comments : Docstring.new(comments, self)
end