Class: Pallets::Serializers::Json

Inherits:
Base
  • Object
show all
Defined in:
lib/pallets/serializers/json.rb

Instance Method Summary collapse

Methods inherited from Base

#dump_context, #load_context

Instance Method Details

#dump(data) ⇒ Object



6
7
8
9
# File 'lib/pallets/serializers/json.rb', line 6

def dump(data)
  # TODO: Remove option after dropping support for Ruby 2.3
  JSON.generate(data, quirks_mode: true)
end

#load(data) ⇒ Object



11
12
13
# File 'lib/pallets/serializers/json.rb', line 11

def load(data)
  JSON.parse(data, quirks_mode: true)
end