Class: JsDuck::Tag::BooleanTag
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.
Direct Known Subclasses
Abstract, Accessor, Chainable, Evented, Hide, Ignore, Inheritable, New, Private, Protected, Readonly, Singleton, Static, Template
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
Instance Attribute Summary
Attributes inherited from Tag
#css, #ext_define_default, #ext_define_pattern, #html_position, #pattern, #repeatable, #signature, #tagname
Instance Method Summary collapse
-
#initialize ⇒ BooleanTag
constructor
A new instance of BooleanTag.
-
#parse_doc(p, pos) ⇒ Object
Parses just the name of the tag.
-
#process_doc(h, docs, pos) ⇒ Object
When the tag is found, its value will always be true.
Methods inherited from Tag
descendants, #format, #parse_ext_define, #to_html
Constructor Details
#initialize ⇒ BooleanTag
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 |