Class: Bootstrap::IconRenderer
- Inherits:
-
Object
- Object
- Bootstrap::IconRenderer
- Defined in:
- app/helpers/bootstrap/icon_renderer.rb
Constant Summary collapse
- ArgumentError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#options ⇒ Object
Returns the value of attribute options.
-
#template ⇒ Object
Returns the value of attribute template.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(template, *args) ⇒ IconRenderer
constructor
A new instance of IconRenderer.
Constructor Details
#initialize(template, *args) ⇒ IconRenderer
Returns a new instance of IconRenderer.
8 9 10 11 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 8 def initialize(template, *args) self.template = template process_arguments(args) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
6 7 8 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 6 def args @args end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 6 def @options end |
#template ⇒ Object
Returns the value of attribute template.
6 7 8 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 6 def template @template end |
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 6 def text @text end |
Instance Method Details
#html ⇒ Object
13 14 15 16 17 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 13 def html icon_tag.tap do |tag| tag << text if text.present? end end |