Class: Prawn::Icon::Compatibility
- Inherits:
-
Object
- Object
- Prawn::Icon::Compatibility
- Defined in:
- lib/prawn/icon/compatibility.rb
Constant Summary collapse
- SHIMS =
Deprecated.
Use shims instead
YAML.load_file( Prawn::Icon.configuration.font_directory.join( 'fa4', 'shims.yml' ) ).freeze
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Compatibility
constructor
A new instance of Compatibility.
- #translate(io = $stderr) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Compatibility
Returns a new instance of Compatibility.
30 31 32 |
# File 'lib/prawn/icon/compatibility.rb', line 30 def initialize(opts = {}) self.key = opts.fetch(:key) end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
28 29 30 |
# File 'lib/prawn/icon/compatibility.rb', line 28 def key @key end |
Class Method Details
.shims ⇒ Object
21 22 23 24 25 |
# File 'lib/prawn/icon/compatibility.rb', line 21 def shims @shims ||= YAML.load_file( Icon.configuration.font_directory.join('fa4', 'shims.yml').to_s ) end |
Instance Method Details
#translate(io = $stderr) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/prawn/icon/compatibility.rb', line 34 def translate(io = $stderr) @translate ||= if key.start_with?('fa-') map.tap { |replaced| warning(replaced, key, io) } else key end end |