Sha256: fefff1b60382de2a1f99fdad63f88f5dee615da9b182e6de7de0b1633cecaf68

Contents?: true

Size: 429 Bytes

Versions: 8

Compression:

Stored size: 429 Bytes

Contents

# frozen_string_literal: true

require "json"
require_relative "context_data_deserializer"
require_relative "json/context_data"

class DefaultContextDataDeserializer < ContextDataDeserializer
  attr_accessor :log, :reader

  def deserialize(bytes, offset, length)
    parse = JSON.parse(bytes[offset..length], symbolize_names: true)
    @reader = ContextData.new(parse[:experiments])
  rescue JSON::ParserError
    nil
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
absmartly-sdk-1.1.2 lib/default_context_data_deserializer.rb
absmartly-sdk-1.1.1 lib/default_context_data_deserializer.rb
absmartly-sdk-1.1.0 lib/default_context_data_deserializer.rb
absmartly-sdk-1.0.8 lib/default_context_data_deserializer.rb
absmartly-sdk-1.0.7 lib/default_context_data_deserializer.rb
absmartly-sdk-1.0.6 lib/default_context_data_deserializer.rb
absmartly-sdk-1.0.5 lib/default_context_data_deserializer.rb
absmartly-sdk-0.1.2 lib/default_context_data_deserializer.rb