module VCR::Cassette::Serializers::Psych
The Psych
serializer. Psych
is the new YAML
engine in ruby 1.9.
Constants
- ENCODING_ERRORS
@private
Public Instance Methods
deserialize(string)
click to toggle source
file_extension()
click to toggle source
The file extension to use for this serializer.
@return [String] “yml”
# File lib/vcr/cassette/serializers/psych.rb, line 21 def file_extension "yml" end
serialize(hash)
click to toggle source
Serializes the given hash using Psych
.
@param [Hash] hash the object to serialize @return [String] the YAML
string
# File lib/vcr/cassette/serializers/psych.rb, line 29 def serialize(hash) handle_encoding_errors do result = ::Psych.dump(hash) result.gsub!(": \n", ": null\n") # set canonical null value in order to avoid trailing whitespaces result end end