module Satz::Serializer

The JSON module from stdlib provides a safe way of loading data with the `parse` method, but the most widespread API for encoding and decoding data is with the `load` and `dump` methods, which in the case of JSON are unsafe. This module wraps the JSON constant from stdlib in order to expose a safe version of `load`. As the serializer is configurable, the user is expected to provide objects that respond safely to those methods.

Public Class Methods

dump(value) click to toggle source
# File lib/satz.rb, line 41
def self.dump(value)
  JSON.dump(value)
end
load(value) click to toggle source
# File lib/satz.rb, line 37
def self.load(value)
  JSON.load(value, nil, create_additions: false)
end