Class: MarkdownUI::Tag

Inherits:
Shared::TagKlass
  • Object
show all
Defined in:
lib/markdown-ui/tag/tag.rb

Instance Method Summary collapse

Constructor Details

#initialize(_tag, _content, _klass = nil, _data = nil) ⇒ Tag

Returns a new instance of Tag.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/markdown-ui/tag/tag.rb', line 3

def initialize(_tag, _content, _klass = nil, _data = nil)
  @elements = Hash.new(MarkdownUI::StandardTag).merge(
      div:     MarkdownUI::StandardTag,
      label:   MarkdownUI::LabelTag,
      span:    MarkdownUI::SpanTag,
      article: MarkdownUI::,
      section: MarkdownUI::,
      header:  MarkdownUI::HeaderTag,
      footer:  MarkdownUI::FooterTag
  )

  @tag      = _tag
  @content  = _content
  @klass    = _klass
  @data     = _data
end

Instance Method Details

#renderObject



20
21
22
23
24
# File 'lib/markdown-ui/tag/tag.rb', line 20

def render
  @params = @tag.split

  html { @elements[key].new(content, klass_text, _id, data).render } if content
end