Class: Qiita::Markdown::Filters::CustomBlock::Metadata
- Inherits:
-
Object
- Object
- Qiita::Markdown::Filters::CustomBlock::Metadata
- Defined in:
- lib/qiita/markdown/filters/custom_block.rb
Instance Attribute Summary collapse
-
#subtype ⇒ Object
readonly
Returns the value of attribute subtype.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(text) ⇒ Metadata
constructor
A new instance of Metadata.
Constructor Details
#initialize(text) ⇒ Metadata
Note:
Attribute ‘type` will be nil if `text` is nil
Note:
Attribute ‘subtype` will be nil if `text` does not include white space.
Returns a new instance of Metadata.
26 27 28 29 |
# File 'lib/qiita/markdown/filters/custom_block.rb', line 26 def initialize(text) # Discared after the second word. @type, @subtype = text && text.split(" ") end |
Instance Attribute Details
#subtype ⇒ Object (readonly)
Returns the value of attribute subtype.
21 22 23 |
# File 'lib/qiita/markdown/filters/custom_block.rb', line 21 def subtype @subtype end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
21 22 23 |
# File 'lib/qiita/markdown/filters/custom_block.rb', line 21 def type @type end |