Class: IconHelper::IconCreator
- Inherits:
-
Object
- Object
- IconHelper::IconCreator
- Includes:
- ActionView::Helpers, FormatHelper, ValidIcons
- Defined in:
- app/helpers/icon_helper.rb
Constant Summary
Constants included from ValidIcons
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, options) ⇒ IconCreator
constructor
A new instance of IconCreator.
- #render ⇒ Object
Methods included from FormatHelper
#prepend_class, #squeeze_n_strip
Constructor Details
#initialize(type, options) ⇒ IconCreator
Returns a new instance of IconCreator.
11 12 13 14 |
# File 'app/helpers/icon_helper.rb', line 11 def initialize(type, ) @type = type @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'app/helpers/icon_helper.rb', line 9 def @options end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'app/helpers/icon_helper.rb', line 8 def type @type end |
Instance Method Details
#render ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/helpers/icon_helper.rb', line 16 def render = { type: type, size: .delete(:size).presence || :normal, fw: .delete(:fixed_with).presence, li: .delete(:list_icon).presence, inverse: .delete(:inverse).presence, border: .delete(:border).presence, pull: .delete(:pull).presence, animate: .delete(:animate).presence, orientation: .delete(:orientation).presence # TODO add fa-stack support # stack = options.delete(:stack).presence } prepend_class(, 'fa', render_fa_class()) content_tag :i, nil, end |