Class: FA::Base
- Inherits:
-
Object
- Object
- FA::Base
- Defined in:
- lib/fa/base.rb
Overview
FontAwesome 6 (Pro) Helper core class for inheritance
Constant Summary collapse
- STYLES =
{ nil => 's', solid: 's', regular: 'r', light: 'l', thin: 't', duotone: 'd', brands: 'b', kit_upload: 'k' }.freeze
- MODES =
{ nil => '', sharp: 's' }.freeze
Class Method Summary collapse
-
.p ⇒ Object
Shortcut for create and output safe.
Instance Method Summary collapse
-
#raw ⇒ Object
Outputs the formatted string directly.
-
#safe(html = nil) ⇒ Object
Attempts to call ‘.html_safe` on the the output of `raw`, if available.
Class Method Details
.p ⇒ Object
Shortcut for create and output safe
29 30 31 |
# File 'lib/fa/base.rb', line 29 def self.p(...) new(...).safe end |
Instance Method Details
#raw ⇒ Object
Outputs the formatted string directly.
18 19 20 |
# File 'lib/fa/base.rb', line 18 def raw # end |
#safe(html = nil) ⇒ Object
Attempts to call ‘.html_safe` on the the output of `raw`, if available.
23 24 25 26 |
# File 'lib/fa/base.rb', line 23 def safe(html = nil) output = html || raw output.respond_to?(:html_safe) ? output.html_safe : output end |