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