Class: FontAwesomeHelper::FaIcon
- Inherits:
-
Object
- Object
- FontAwesomeHelper::FaIcon
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/font-awesome-helper/fa_icon.rb
Constant Summary collapse
- FA_CLASS_PREFIX =
'fa'
Instance Method Summary collapse
-
#initialize(names, options = {}) ⇒ FaIcon
constructor
A new instance of FaIcon.
- #to_tag ⇒ Object
Constructor Details
#initialize(names, options = {}) ⇒ FaIcon
Returns a new instance of FaIcon.
6 7 8 9 10 |
# File 'lib/font-awesome-helper/fa_icon.rb', line 6 def initialize(names, = {}) @classes = [FA_CLASS_PREFIX] @classes.concat fa_prefixize(names_to_a(names)) @classes.concat names_to_a(.delete(:class)) end |
Instance Method Details
#to_tag ⇒ Object
12 13 14 |
# File 'lib/font-awesome-helper/fa_icon.rb', line 12 def to_tag content_tag(:i, nil, class: @classes.join(' ')) end |