Module: Sequel::Plugins::QueryCache::Serializer::JSON

Defined in:
lib/sequel-query-cache/serializer/json.rb

Overview

While this works, if you’re using binary data at all, it’s not a great idea and MessagePack is faster.

Class Method Summary collapse

Class Method Details

.deserialize(string) ⇒ Object

Keys are specifically NOT symbolized here. This is done by Sequel::Plugins::Cacheable::DatasetMethods#fetch_rows since only the top level needs to have symbolized keys for Sequel’s purposes.



18
19
20
# File 'lib/sequel-query-cache/serializer/json.rb', line 18

def self.deserialize(string)
  ::JSON.parse(string)
end

.serialize(obj) ⇒ Object



10
11
12
13
# File 'lib/sequel-query-cache/serializer/json.rb', line 10

def self.serialize(obj)
  binding.pry
  obj.to_json
end