Class: Bootstrap::IconRenderer
- Inherits:
-
Object
- Object
- Bootstrap::IconRenderer
- Includes:
- ActionView::Helpers::SanitizeHelper
- 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.
9 10 11 12 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 9 def initialize(template, *args) self.template = template process_arguments(args) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
7 8 9 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 7 def args @args end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 7 def @options end |
#template ⇒ Object
Returns the value of attribute template.
7 8 9 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 7 def template @template end |
#text ⇒ Object
Returns the value of attribute text.
7 8 9 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 7 def text @text end |
Instance Method Details
#html ⇒ Object
14 15 16 17 18 |
# File 'app/helpers/bootstrap/icon_renderer.rb', line 14 def html icon_tag.tap do |tag| tag << text if text.present? end end |