class Pallets::Serializers::Base

Public Instance Methods

dump(data) click to toggle source
# File lib/pallets/serializers/base.rb, line 4
def dump(data)
  raise NotImplementedError
end
Also aliased as: dump_job
dump_context(data) click to toggle source

Context hashes only need their values (de)serialized

# File lib/pallets/serializers/base.rb, line 16
def dump_context(data)
  data.map { |k, v| [k.to_s, dump(v)] }.to_h
end
dump_job(data)
Alias for: dump
load(data) click to toggle source
# File lib/pallets/serializers/base.rb, line 8
def load(data)
  raise NotImplementedError
end
Also aliased as: load_job
load_context(data) click to toggle source
# File lib/pallets/serializers/base.rb, line 20
def load_context(data)
  data.map { |k, v| [k, load(v)] }.to_h
end
load_job(data)
Alias for: load