Module: Cadence::JSON

Defined in:
lib/cadence/json.rb

Constant Summary collapse

OJ_OPTIONS =
{
  mode: :object
}.freeze

Class Method Summary collapse

Class Method Details

.deserialize(value) ⇒ Object



14
15
16
# File 'lib/cadence/json.rb', line 14

def self.deserialize(value)
  Oj.load(value.to_s, OJ_OPTIONS)
end

.serialize(value) ⇒ Object



10
11
12
# File 'lib/cadence/json.rb', line 10

def self.serialize(value)
  Oj.dump(value, OJ_OPTIONS)
end