module VCR::Cassette::Serializers::Syck
def deserialize(string)
-
(Hash)
- the deserialized object
Parameters:
-
string
(String
) -- the YAML string
def deserialize(string) handle_encoding_errors do handle_syntax_errors do using_syck { ::YAML.load(string) } 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 using_syck { ::YAML.dump(hash) } end end
def using_syck
def using_syck return yield unless defined?(::YAML::ENGINE) original_engine = ::YAML::ENGINE.yamler ::YAML::ENGINE.yamler = 'syck' begin yield ensure ::YAML::ENGINE.yamler = original_engine end end