module VCR::Cassette::Serializers::JSON
The JSON
serializer. Uses ‘MultiJson` under the covers.
Constants
- ENCODING_ERRORS
-
@private
Public Instance Methods
Source
# File lib/vcr/cassette/serializers/json.rb, line 40 def deserialize(string) handle_encoding_errors do MultiJson.decode(string) end end
Deserializes the given string using ‘MultiJson`.
@param [String] string the JSON
string @return [Hash] the deserialized object
Source
# File lib/vcr/cassette/serializers/json.rb, line 22 def file_extension "json" end
The file extension to use for this serializer.
@return [String] “json”
Source
# File lib/vcr/cassette/serializers/json.rb, line 30 def serialize(hash) handle_encoding_errors do MultiJson.encode(hash) end end
Serializes the given hash using ‘MultiJson`.
@param [Hash] hash the object to serialize @return [String] the JSON
string