Class: Prawn::Icon::Compatibility
- Inherits:
-
Object
- Object
- Prawn::Icon::Compatibility
- Defined in:
- lib/prawn/icon/compatibility.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
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.
22 23 24 |
# File 'lib/prawn/icon/compatibility.rb', line 22 def initialize(opts = {}) self.key = opts.fetch(:key) end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
20 21 22 |
# File 'lib/prawn/icon/compatibility.rb', line 20 def key @key end |
Instance Method Details
#translate(io = STDERR) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/prawn/icon/compatibility.rb', line 26 def translate(io = STDERR) @translate ||= begin if key.start_with?('fa-') map.tap { |replaced| warning(replaced, key, io) } else key end end end |