Class: Schron::Datastore::Serializer
- Inherits:
-
Object
- Object
- Schron::Datastore::Serializer
- Defined in:
- lib/schron/datastore/serializer.rb
Instance Method Summary collapse
-
#serialize(kind, hash) ⇒ Object
Make this thing into a Hash of Arrays of Floats, ints and strings.
- #unserialize(kind, hash) ⇒ Object
Instance Method Details
#serialize(kind, hash) ⇒ Object
Make this thing into a Hash of Arrays of Floats, ints and strings
12 13 14 15 16 |
# File 'lib/schron/datastore/serializer.rb', line 12 def serialize(kind, hash) hash.each_with_object({}) do |(field, value), h| h[field] = serialize_value(value) end end |
#unserialize(kind, hash) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/schron/datastore/serializer.rb', line 18 def unserialize(kind, hash) Schron::Util.symbolize_keys(hash) # hash.each_with_object({}) do |(field, value), hash| # hash[field] = unserialize_value(value) # end # ) end |