Class: Decode::Comment::Attribute
- Defined in:
- lib/decode/comment/attribute.rb
Overview
Describes an attribute type.
-
‘@attribute [Integer] The person’s age.‘
Constant Summary collapse
- PATTERN =
/\A\[(?<type>.*?)\](\s+(?<details>.*?))?\Z/
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
The details associated with the tag.
-
#type ⇒ Object
readonly
The type of the attribute.
Attributes inherited from Tag
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(directive, type) ⇒ Attribute
constructor
A new instance of Attribute.
- #text ⇒ Object
Methods inherited from Tag
Methods inherited from Node
#add, #children?, #each, #traverse
Constructor Details
#initialize(directive, type) ⇒ Attribute
Returns a new instance of Attribute.
42 43 44 45 46 |
# File 'lib/decode/comment/attribute.rb', line 42 def initialize(directive, type) super(directive) @type = type end |
Instance Attribute Details
#details ⇒ Object (readonly)
The details associated with the tag.
54 55 56 |
# File 'lib/decode/comment/attribute.rb', line 54 def details @details end |
#type ⇒ Object (readonly)
The type of the attribute.
50 51 52 |
# File 'lib/decode/comment/attribute.rb', line 50 def type @type end |
Class Method Details
Instance Method Details
#text ⇒ Object
56 57 58 |
# File 'lib/decode/comment/attribute.rb', line 56 def text text = super end |