Module: VCR::Cassette::Serializers::Psych
- Extended by:
- EncodingErrorHandling, Psych
- Included in:
- Psych
- Defined in:
- lib/vcr/cassette/serializers/psych.rb
Overview
The Psych serializer. Psych is the new YAML engine in ruby 1.9.
Constant Summary collapse
- ENCODING_ERRORS =
[ArgumentError]
Instance Method Summary collapse
-
#deserialize(string) ⇒ Hash
Deserializes the given string using Psych.
-
#file_extension ⇒ String
The file extension to use for this serializer.
-
#serialize(hash) ⇒ String
Serializes the given hash using Psych.
Methods included from EncodingErrorHandling
Instance Method Details
#deserialize(string) ⇒ Hash
Deserializes the given string using Psych.
39 40 41 42 43 |
# File 'lib/vcr/cassette/serializers/psych.rb', line 39 def deserialize(string) handle_encoding_errors do ::Psych.load(string) end end |
#file_extension ⇒ String
The file extension to use for this serializer.
21 22 23 |
# File 'lib/vcr/cassette/serializers/psych.rb', line 21 def file_extension "yml" end |
#serialize(hash) ⇒ String
Serializes the given hash using Psych.
29 30 31 32 33 |
# File 'lib/vcr/cassette/serializers/psych.rb', line 29 def serialize(hash) handle_encoding_errors do ::Psych.dump(hash) end end |