Class: MarkdownUI::SpanTag

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

Instance Method Summary collapse

Constructor Details

#initialize(content, klass = nil) ⇒ SpanTag

Returns a new instance of SpanTag.



3
4
5
6
# File 'lib/markdown-ui/tag/span_tag.rb', line 3

def initialize(content, klass = nil)
  @klass = klass
  @content = content
end

Instance Method Details

#renderObject



8
9
10
11
12
# File 'lib/markdown-ui/tag/span_tag.rb', line 8

def render
  klass = "#{@klass}".downcase.split(' ').uniq

  "<span class=\"#{klass.join(' ').strip}\">#{@content}</span>"
end