Class: JsDuck::Tag::BooleanTag

Inherits:
Tag
  • Object
show all
Defined in:
lib/jsduck/tag/boolean_tag.rb

Overview

Base class for simple boolean @tags. Subclasses should only define @pattern and call #super, which will take care of setting up @tagname with the same name.

Constant Summary

Constants inherited from Tag

Tag::POS_ASIDE, Tag::POS_DEFAULT, Tag::POS_DEPRECATED, Tag::POS_DOC, Tag::POS_ENUM, Tag::POS_FIRES, Tag::POS_LOCALDOC, Tag::POS_OVERRIDES, Tag::POS_PARAM, Tag::POS_PREVENTABLE, Tag::POS_PRIVATE, Tag::POS_RETURN, Tag::POS_SINCE, Tag::POS_SUBPROPERTIES, Tag::POS_TEMPLATE, Tag::POS_THROWS, Tag::PRIORITY_CLASS, Tag::PRIORITY_COMPONENT, Tag::PRIORITY_SINGLETON

Instance Attribute Summary

Attributes inherited from Tag

#class_icon, #css, #ext_define_default, #ext_define_pattern, #html_position, #pattern, #repeatable, #signature, #tagname

Instance Method Summary collapse

Methods inherited from Tag

descendants, #format, #parse_ext_define, #to_html

Constructor Details

#initializeBooleanTag

Returns a new instance of BooleanTag.



8
9
10
11
12
# File 'lib/jsduck/tag/boolean_tag.rb', line 8

def initialize
  if @pattern
    @tagname = @pattern.to_sym
  end
end

Instance Method Details

#parse_doc(p, pos) ⇒ Object

Parses just the name of the tag.



15
16
17
# File 'lib/jsduck/tag/boolean_tag.rb', line 15

def parse_doc(p, pos)
  {:tagname => @tagname}
end

#process_doc(h, docs, pos) ⇒ Object

When the tag is found, its value will always be true.



20
21
22
# File 'lib/jsduck/tag/boolean_tag.rb', line 20

def process_doc(h, docs, pos)
  h[@tagname] = true
end