Class: MarkdownUI::Tag
- Inherits:
-
Shared::TagKlass
- Object
- Shared::TagKlass
- MarkdownUI::Tag
- Defined in:
- lib/markdown-ui/tag/tag.rb
Instance Method Summary collapse
-
#initialize(_tag, _content, _klass = nil, _data = nil) ⇒ Tag
constructor
A new instance of Tag.
- #render ⇒ Object
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::ArticleTag, section: MarkdownUI::SectionTag, header: MarkdownUI::HeaderTag, footer: MarkdownUI:: ) @tag = _tag @content = _content @klass = _klass @data = _data end |
Instance Method Details
#render ⇒ Object
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 |