Module: VCR::Cassette::Serializers::Syck
- Extended by:
- EncodingErrorHandling, Syck, VCR::Cassette::SyntaxErrorHandling
- Included in:
- Syck
- Defined in:
- lib/vcr/cassette/serializers/syck.rb
Overview
The Syck serializer. Syck is the legacy YAML engine in ruby 1.8 and 1.9.
Constant Summary collapse
- ENCODING_ERRORS =
[ArgumentError]
- SYNTAX_ERRORS =
[::Psych::SyntaxError]
Instance Method Summary collapse
-
#deserialize(string) ⇒ Hash
Deserializes the given string using Syck.
-
#file_extension ⇒ String
The file extension to use for this serializer.
-
#serialize(hash) ⇒ String
Serializes the given hash using Syck.
Methods included from EncodingErrorHandling
Methods included from VCR::Cassette::SyntaxErrorHandling
Instance Method Details
#deserialize(string) ⇒ Hash
Deserializes the given string using Syck.
43 44 45 46 47 48 49 |
# File 'lib/vcr/cassette/serializers/syck.rb', line 43 def deserialize(string) handle_encoding_errors do handle_syntax_errors do using_syck { ::YAML.load(string) } end end end |
#file_extension ⇒ String
The file extension to use for this serializer.
25 26 27 |
# File 'lib/vcr/cassette/serializers/syck.rb', line 25 def file_extension "yml" end |
#serialize(hash) ⇒ String
Serializes the given hash using Syck.
33 34 35 36 37 |
# File 'lib/vcr/cassette/serializers/syck.rb', line 33 def serialize(hash) handle_encoding_errors do using_syck { ::YAML.dump(hash) } end end |