class Synapse::Serialization::MarshalSerializer
Implementation of a serializer that uses the built-in marshaling library
Note that this serializer is not necessarily the fastest serializer available, nor is it flexible. Output is binary and difficult to modify, which means upcasting is not possible when using this serializer.
This serializer wraps the binary output of Marshal in Base64 encoding.
Protected Instance Methods
native_content_type()
click to toggle source
@return [Class]
# File lib/synapse/serialization/serializer/marshal.rb, line 29 def native_content_type String end
perform_deserialize(content, type)
click to toggle source
@param [Object] content @param [Class] type @return [Object]
# File lib/synapse/serialization/serializer/marshal.rb, line 24 def perform_deserialize(content, type) Marshal.load(Base64.decode64(content)) end
perform_serialize(content)
click to toggle source
@param [Object] content @return [Object]
# File lib/synapse/serialization/serializer/marshal.rb, line 17 def perform_serialize(content) Base64.encode64(Marshal.dump(content)) end