Class: Rets::Metadata::MarshalSerializer
- Inherits:
-
Object
- Object
- Rets::Metadata::MarshalSerializer
- Defined in:
- lib/rets/metadata/marshal_serializer.rb
Overview
Serialize/Deserialize metadata using Marshal.
Instance Method Summary collapse
-
#load(file) ⇒ Object
Deserialize from a file.
-
#save(file, o) ⇒ Object
Serialize to a file.
Instance Method Details
#load(file) ⇒ Object
Deserialize from a file. If the metadata cannot be deserialized, return nil.
18 19 20 21 22 |
# File 'lib/rets/metadata/marshal_serializer.rb', line 18 def load(file) Marshal.load(file) rescue TypeError nil end |
#save(file, o) ⇒ Object
Serialize to a file. The library reserves the right to change the type or contents of o, so don’t depend on it being anything in particular.
12 13 14 |
# File 'lib/rets/metadata/marshal_serializer.rb', line 12 def save(file, o) Marshal.dump(o, file) end |