class RubyLint::Docstring::Mapping

{RubyLint::Docstring::Mapping} is a small data container for storing docstring tags separately and optionally by their names (e.g. for parameter tags).

@!attribute [r] param_tags

@return [Hash]

@!attribute [r] return_tag

@return [RubyLint::Docstring::ReturnTag]

Constants

TAG_METHODS

Hash containing the known tag classes and their callback methods.

@return [Hash]

Attributes

param_tags[R]
return_tag[R]

Public Class Methods

new(tags = []) click to toggle source

@param [Array] tags

# File lib/ruby-lint/docstring/mapping.rb, line 30
def initialize(tags = [])
  @param_tags = {}

  tags.each do |tag|
    send(TAG_METHODS[tag.class], tag)
  end
end

Private Instance Methods

on_param_tag(tag) click to toggle source

@param [RubyLint::Docstring::ParamTag] tag

# File lib/ruby-lint/docstring/mapping.rb, line 43
def on_param_tag(tag)
  @param_tags[tag.name] = tag
end
on_return_tag(tag) click to toggle source

@param [RubyLint::Docstring::ReturnTag] tag

# File lib/ruby-lint/docstring/mapping.rb, line 50
def on_return_tag(tag)
  @return_tag = tag
end