class JsDuck::Tag::Inheritdoc

Public Class Methods

new() click to toggle source
# File lib/jsduck/tag/inheritdoc.rb, line 6
def initialize
  @pattern = ["inheritdoc", "inheritDoc"]
  @tagname = :inheritdoc
end

Public Instance Methods

parse_as_inheritdoc(p) click to toggle source

This separate method exits to allow it to be also called from @alias tag implementation.

Matches a member reference: <class.name> “#” <static> “-” <type> “-” <member>

Returns :inheritdoc tag definition with corresponding fields.

# File lib/jsduck/tag/inheritdoc.rb, line 22
def parse_as_inheritdoc(p)
  tag = {
    :tagname => :inheritdoc,
    :cls => p.ident_chain,
  }

  if p.look(/#\w/)
    p.match(/#/)
    if p.look(/static-/)
      tag[:static] = true
      p.match(/static-/)
    end
    if p.look(JsDuck::MemberRegistry.regex)
      tag[:type] = p.match(/\w+/).to_sym
      p.match(/-/)
    end
    tag[:member] = p.ident
  end

  tag
end
parse_doc(p, pos) click to toggle source

@inheritdoc class.name#static-type-member

# File lib/jsduck/tag/inheritdoc.rb, line 12
def parse_doc(p, pos)
  parse_as_inheritdoc(p)
end
process_doc(h, docs, pos) click to toggle source
# File lib/jsduck/tag/inheritdoc.rb, line 44
def process_doc(h, docs, pos)
  h[:inheritdoc] = docs.first
end