class Rets::Metadata::YamlSerializer

Serialize/Deserialize metadata using Marshal.

Public Instance Methods

load(file) click to toggle source

Deserialize from a file. If the metadata cannot be deserialized, return nil.

# File lib/rets/metadata/yaml_serializer.rb, line 18
def load(file)
  YAML.load(file)
rescue Psych::SyntaxError
  nil
end
save(file, o) click to toggle source

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.

# File lib/rets/metadata/yaml_serializer.rb, line 12
def save(file, o)
  YAML.dump(o, file)
end