Module: StrokeDB::MarshalSerializationMethod

Defined in:
lib/strokedb/util/serialization.rb

Instance Method Summary collapse

Instance Method Details

#deserialize(x) ⇒ Object



37
38
39
# File 'lib/strokedb/util/serialization.rb', line 37

def deserialize(x)
 Marshal.load(x)
end

#serialize(x) ⇒ Object



33
34
35
36
# File 'lib/strokedb/util/serialization.rb', line 33

def serialize(x)
  x = x.to_raw if x.respond_to?(:to_raw)
  Marshal.dump(x)
end