Class: MarkdownUI::Button::LabeledIcon
- Inherits:
-
Object
- Object
- MarkdownUI::Button::LabeledIcon
- Defined in:
- lib/markdown-ui/button/labeled_icon.rb
Instance Method Summary collapse
-
#initialize(icon, label, klass = nil, _id = nil) ⇒ LabeledIcon
constructor
A new instance of LabeledIcon.
- #render ⇒ Object
Constructor Details
#initialize(icon, label, klass = nil, _id = nil) ⇒ LabeledIcon
5 6 7 8 9 10 |
# File 'lib/markdown-ui/button/labeled_icon.rb', line 5 def initialize(icon, label, klass = nil, _id = nil) @klass = klass @icon = icon @label = label @id = _id end |
Instance Method Details
#render ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/markdown-ui/button/labeled_icon.rb', line 12 def render icon = MarkdownUI::Content::Parser.new(@icon).parse label = MarkdownUI::Content::Parser.new(@label).parse klass = "ui #{@klass} labeled icon button" _id = @id content = [] content << icon content << label MarkdownUI::StandardTag.new(content.join, klass, _id).render end |