Class: Bootstrap::IconRenderer

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::SanitizeHelper
Defined in:
app/helpers/bootstrap/icon_renderer.rb

Constant Summary collapse

ArgumentError =
Class.new(StandardError)

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject

Returns the value of attribute args.



7
8
9
# File 'app/helpers/bootstrap/icon_renderer.rb', line 7

def args
  @args
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'app/helpers/bootstrap/icon_renderer.rb', line 7

def options
  @options
end

#templateObject

Returns the value of attribute template.



7
8
9
# File 'app/helpers/bootstrap/icon_renderer.rb', line 7

def template
  @template
end

#textObject

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

#htmlObject



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