Class: FA::Icon
Overview
FontAwesome 5 (Pro) Helper for generating icons
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(fa, options = {}) ⇒ Icon
constructor
Creates a new Icon instance.
-
#raw ⇒ Object
Outputs the formatted icon directly.
Methods inherited from Base
Constructor Details
#initialize(fa, options = {}) ⇒ Icon
Creates a new Icon instance
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fa/icon.rb', line 11 def initialize(fa, = {}) @options = if fa.is_a?(Hash) @name = fa[:name] @options = fa[:options] elsif fa.is_a?(String) || fa.is_a?(Symbol) @name = fa.to_s else raise ArgumentError, 'Unexpected argument type.' end end |
Instance Method Details
#raw ⇒ Object
Outputs the formatted icon directly.
24 25 26 |
# File 'lib/fa/icon.rb', line 24 def raw parse_icon(@name, @options) end |