Class: Nanite::Serializer
Defined Under Namespace
Classes: SerializationError
Instance Method Summary collapse
- #dump(packet) ⇒ Object
-
#initialize(preferred_format = "marshal") ⇒ Serializer
constructor
SerializationError.
- #load(packet) ⇒ Object
Constructor Details
#initialize(preferred_format = "marshal") ⇒ Serializer
SerializationError
12 13 14 15 16 17 |
# File 'lib/nanite/serializer.rb', line 12 def initialize(preferred_format="marshal") preferred_format ||= "marshal" preferred_serializer = SERIALIZERS[preferred_format.to_sym] @serializers = SERIALIZERS.values.clone @serializers.unshift(@serializers.delete(preferred_serializer)) if preferred_serializer end |