Class: DefaultContextDataDeserializer
- Inherits:
-
ContextDataDeserializer
- Object
- ContextDataDeserializer
- DefaultContextDataDeserializer
- Defined in:
- lib/default_context_data_deserializer.rb
Instance Attribute Summary collapse
-
#log ⇒ Object
Returns the value of attribute log.
-
#reader ⇒ Object
Returns the value of attribute reader.
Instance Method Summary collapse
Instance Attribute Details
#log ⇒ Object
Returns the value of attribute log.
8 9 10 |
# File 'lib/default_context_data_deserializer.rb', line 8 def log @log end |
#reader ⇒ Object
Returns the value of attribute reader.
8 9 10 |
# File 'lib/default_context_data_deserializer.rb', line 8 def reader @reader end |
Instance Method Details
#deserialize(bytes, offset, length) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/default_context_data_deserializer.rb', line 10 def deserialize(bytes, offset, length) parse = JSON.parse(bytes[offset..length], symbolize_names: true) @reader = ContextData.new(parse[:experiments]) rescue JSON::ParserError nil end |