Class: RailsBootstrapHelpers::Renderers::IconicIconRenderer

Inherits:
Renderer
  • Object
show all
Defined in:
lib/rails-bootstrap-helpers/renderers/iconic_icon_renderer.rb

Instance Attribute Summary

Attributes inherited from Renderer

#template

Instance Method Summary collapse

Methods inherited from Renderer

#method_missing

Constructor Details

#initialize(template, icon, options) ⇒ IconicIconRenderer

Returns a new instance of IconicIconRenderer.



3
4
5
6
7
# File 'lib/rails-bootstrap-helpers/renderers/iconic_icon_renderer.rb', line 3

def initialize (template, icon, options)
  super template
  @icon = icon
  @options = options.dup
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RailsBootstrapHelpers::Renderers::Renderer

Instance Method Details

#renderObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rails-bootstrap-helpers/renderers/iconic_icon_renderer.rb', line 9

def render
  icon = ERB::Util.html_escape(@icon.to_s)
  append_class!(options, "iconic-#{icon}")
  append_style(:color, options.delete(:color))
  
  handle_size
  handle_bs_style
  handle_action_style

   :i, "", bs_options(options)
end