Class: Qiita::Markdown::Filters::CustomBlock::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/qiita/markdown/filters/custom_block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • text (String, nil)


24
25
26
27
# File 'lib/qiita/markdown/filters/custom_block.rb', line 24

def initialize(text)
  # Discared after the second word.
  @type, @subtype = text && text.split(" ")
end

Instance Attribute Details

#subtypeObject (readonly)

Returns the value of attribute subtype.



19
20
21
# File 'lib/qiita/markdown/filters/custom_block.rb', line 19

def subtype
  @subtype
end

#typeObject (readonly)

Returns the value of attribute type.



19
20
21
# File 'lib/qiita/markdown/filters/custom_block.rb', line 19

def type
  @type
end