Module: FieldMapper::Marshaller

Included in:
Standard::Field, Standard::Plat
Defined in:
lib/field_mapper/marshaller.rb

Constant Summary collapse

OPTIONS =
{
  indent: 0,
  circular: false,
  class_cache: true,
  escape: :json,
  time: :unix,
  create_id: "field_mapper_json_create"
}

Instance Method Summary collapse

Instance Method Details

#marshal(value) ⇒ Object



15
16
17
# File 'lib/field_mapper/marshaller.rb', line 15

def marshal(value)
  Oj.dump prep_value(value), OPTIONS
end

#unmarshal(value) ⇒ Object



19
20
21
# File 'lib/field_mapper/marshaller.rb', line 19

def unmarshal(value)
  Oj.load value, OPTIONS
end