class VCR::ResponseStatus

The response status of an {HTTPInteraction}.

@attr [Integer] code the HTTP status code @attr [String] message the HTTP status message (e.g. “OK” for a status of 200)

Public Class Methods

from_hash(hash) click to toggle source

Constructs a new instance from a hash.

@param [Hash] hash the hash to use to construct the instance. @return [ResponseStatus] the response status

# File lib/vcr/structs.rb, line 458
def self.from_hash(hash)
  new hash['code'], hash['message']
end

Public Instance Methods

to_hash() click to toggle source

@return [Hash] hash that represents this response status

and can be easily serialized.

@see ::from_hash

# File lib/vcr/structs.rb, line 448
def to_hash
  {
    'code' => code, 'message' => message
  }.tap { |h| OrderedHashSerializer.apply_to(h, members) }
end