Class: Bootstrap::IconRenderer

Inherits:
Object
  • Object
show all
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.



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

#argsObject

Returns the value of attribute args.



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

def args
  @args
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#templateObject

Returns the value of attribute template.



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

def template
  @template
end

#textObject

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

#htmlObject



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