Class: MarkdownUI::CustomTag

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

Instance Method Summary collapse

Constructor Details

#initialize(_tag, _content, _klass = nil) ⇒ CustomTag

Returns a new instance of CustomTag.



4
5
6
7
8
# File 'lib/markdown-ui/tag/custom_tag.rb', line 4

def initialize(_tag, _content, _klass = nil)
  @tag     = _tag
  @klass   = _klass
  @content = _content
end

Instance Method Details

#renderObject



10
11
12
13
14
15
16
17
18
# File 'lib/markdown-ui/tag/custom_tag.rb', line 10

def render
  output = []
  output << "<#{tag}"
  output << "#{klass}>"
  output << content
  output << "</#{tag}>"

  output.join(' ')
end