Class YARD::Docstring
In: lib/yard/docstring.rb
Parent: String

Methods

add_tag   all=   blank?   has_tag?   line   new   replace   summary   tag   tags  

Constants

META_MATCH = /^@([a-z_]+)(?:\s+(.*))?$/i

Attributes

all  [RW] 
line_range  [RW] 
object  [RW] 
ref_tags  [R] 

Public Class methods

Public Instance methods

Adds a tag or reftag object to the tag list

@param [Tags::Tag, Tags::RefTag] *tags list of tag objects to add

all=(content)

Alias for replace

Returns true if the docstring has no content

@return [Boolean] whether or not the docstring has content

Returns true if at least one tag by the name name was declared

@param [String] name the tag name to search for @return [Boolean] whether or not the tag name was declared

Gets the first line of a docstring to the period or the first paragraph.

@return [String] The first line or paragraph of the docstring; always ends with a period.

Convenience method to return the first tag object in the list of tag objects of that name

@example

  doc = YARD::Docstring.new("@return zero when nil")
  doc.tag(:return).text  # => "zero when nil"

@param [to_s] name the tag name to return data for @return [Tags::Tag] the first tag in the list of {tags}

Returns a list of tags specified by name or all tags if name is not specified.

@param name the tag name to return data for, or nil for all tags @return [Array<Tags::Tag>] the list of tags by the specified tag name

[Validate]