Module: VCR::Cassette::Serializers::YAML
Overview
The YAML serializer. This will use either Psych or Syck, which ever your ruby interpreter defaults to. You can also force VCR to use Psych or Syck by using one of those serializers.
Constant Summary
Instance Method Summary (collapse)
-
- (Hash) deserialize(string)
Deserializes the given string using YAML.
-
- (String) file_extension
The file extension to use for this serializer.
-
- (String) serialize(hash)
Serializes the given hash using YAML.
Instance Method Details
- (Hash) deserialize(string)
Deserializes the given string using YAML.
41 42 43 44 45 |
# File 'lib/vcr/cassette/serializers/yaml.rb', line 41 def deserialize(string) handle_encoding_errors do ::YAML.load(string) end end |
- (String) file_extension
The file extension to use for this serializer.
23 24 25 |
# File 'lib/vcr/cassette/serializers/yaml.rb', line 23 def file_extension "yml" end |
- (String) serialize(hash)
Serializes the given hash using YAML.
31 32 33 34 35 |
# File 'lib/vcr/cassette/serializers/yaml.rb', line 31 def serialize(hash) handle_encoding_errors do ::YAML.dump(hash) end end |