Class: Rollbar::Encoding::LegacyEncoder
- Inherits:
-
Object
- Object
- Rollbar::Encoding::LegacyEncoder
- Defined in:
- lib/rollbar/encoding/legacy_encoder.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(object) ⇒ LegacyEncoder
constructor
A new instance of LegacyEncoder.
Constructor Details
#initialize(object) ⇒ LegacyEncoder
Returns a new instance of LegacyEncoder.
8 9 10 |
# File 'lib/rollbar/encoding/legacy_encoder.rb', line 8 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
6 7 8 |
# File 'lib/rollbar/encoding/legacy_encoder.rb', line 6 def object @object end |
Instance Method Details
#encode ⇒ Object
12 13 14 15 16 17 |
# File 'lib/rollbar/encoding/legacy_encoder.rb', line 12 def encode value = object.to_s encoded_value = ::Iconv.conv('UTF-8//IGNORE', 'UTF-8', value) object.is_a?(Symbol) ? encoded_value.to_sym : encoded_value end |