Class: Nanite::Serializer
Defined Under Namespace
Classes: SerializationError
Instance Method Summary collapse
- #dump(packet) ⇒ Object
-
#initialize(preferred_format = :marshal) ⇒ Serializer
constructor
The secure serializer should not be part of the cascading.
- #load(packet) ⇒ Object
Constructor Details
#initialize(preferred_format = :marshal) ⇒ Serializer
The secure serializer should not be part of the cascading
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/nanite/serializer.rb', line 14 def initialize(preferred_format = :marshal) preferred_format ||= :marshal if preferred_format.to_s == 'secure' @serializers = [ SecureSerializer ] else preferred_serializer = SERIALIZERS[preferred_format.to_sym] @serializers = SERIALIZERS.values.clone @serializers.unshift(@serializers.delete(preferred_serializer)) if preferred_serializer end end |