Method: YARD::Docstring#tag

Defined in:
lib/yard/docstring.rb

#tag(name) ⇒ Tags::Tag

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

Examples:

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

Parameters:

  • name (#to_s)

    the tag name to return data for

Returns:


208
209
210
# File 'lib/yard/docstring.rb', line 208

def tag(name)
  tags.find {|tag| tag.tag_name.to_s == name.to_s }
end