module FieldMapper::Marshaller
Constants
- OPTIONS
Public Instance Methods
marshal(value)
click to toggle source
# File lib/field_mapper/marshaller.rb, line 15 def marshal(value) Oj.dump prep_value(value), OPTIONS end
unmarshal(value)
click to toggle source
# File lib/field_mapper/marshaller.rb, line 19 def unmarshal(value) Oj.load value, OPTIONS end
Private Instance Methods
prep_value(value)
click to toggle source
# File lib/field_mapper/marshaller.rb, line 25 def prep_value(value) return value.map { |v| prep_value v } if value.is_a?(Array) return value.to_hash if value.is_a?(HashWithIndifferentAccess) value end