module VCR::Cassette::Serializers::Psych

def deserialize(string)

Returns:
  • (Hash) - the deserialized object

Parameters:
  • string (String) -- the YAML string
def deserialize(string)
  handle_encoding_errors do
    handle_syntax_errors do
      ::Psych.load(string)
    end
  end
end

def file_extension

Returns:
  • (String) - "yml"
def file_extension
  "yml"
end

def serialize(hash)

Returns:
  • (String) - the YAML string

Parameters:
  • hash (Hash) -- the object to serialize
def serialize(hash)
  handle_encoding_errors do
    result = ::Psych.dump(hash)
    result.gsub!(": \n", ": null\n") # set canonical null value in order to avoid trailing whitespaces
    result
  end
end