Sha256: d53a01045aee11c789bb40c89eabb8d9b6c338c74b7d38c136a56e19c1152c70
Contents?: true
Size: 1.19 KB
Versions: 5
Compression:
Stored size: 1.19 KB
Contents
require 'yaml' module VCR class Cassette class Serializers # 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. # # @see JSON # @see Psych # @see Syck module YAML extend self extend EncodingErrorHandling # @private ENCODING_ERRORS = [ArgumentError] # The file extension to use for this serializer. # # @return [String] "yml" def file_extension "yml" end # Serializes the given hash using YAML. # # @param [Hash] hash the object to serialize # @return [String] the YAML string def serialize(hash) handle_encoding_errors do ::YAML.dump(hash) end end # Deserializes the given string using YAML. # # @param [String] string the YAML string # @param [Hash] hash the deserialized object def deserialize(string) handle_encoding_errors do ::YAML.load(string) end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems