module VCR::Cassette::Serializers::YAML
def deserialize(string)
-
(Hash)
- the deserialized object
Parameters:
-
string
(String
) -- the YAML string
def deserialize(string) handle_encoding_errors do handle_syntax_errors do if ::YAML.respond_to?(:unsafe_load) ::YAML.unsafe_load(string) else ::YAML.load(string) end end end end
def file_extension
-
(String)
- "yml"
def file_extension "yml" end
def serialize(hash)
-
(String)
- the YAML string
Parameters:
-
hash
(Hash
) -- the object to serialize
def serialize(hash) handle_encoding_errors do result = ::YAML.dump(hash) result.gsub!(": \n", ": null\n") # set canonical null value in order to avoid trailing whitespaces result end end