Module: VCR::Cassette::Serializers::Syck
- Extended by:
- EncodingErrorHandling, Syck
- 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]
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
Instance Method Details
#deserialize(string) ⇒ Hash
Deserializes the given string using Syck.
39 40 41 42 43 |
# File 'lib/vcr/cassette/serializers/syck.rb', line 39 def deserialize(string) handle_encoding_errors do using_syck { ::YAML.load(string) } end end |
#file_extension ⇒ String
The file extension to use for this serializer.
21 22 23 |
# File 'lib/vcr/cassette/serializers/syck.rb', line 21 def file_extension "yml" end |
#serialize(hash) ⇒ String
Serializes the given hash using Syck.
29 30 31 32 33 |
# File 'lib/vcr/cassette/serializers/syck.rb', line 29 def serialize(hash) handle_encoding_errors do using_syck { ::YAML.dump(hash) } end end |