class VCR::HTTPInteraction
@attr [Time] recorded_at when this HTTP interaction was recorded
@attr [Response] response the response
@attr [Request] request the request
Represents a single interaction over HTTP, containing a request and a response.
def self.from_hash(hash)
-
(HTTPInteraction)- the HTTP interaction
Parameters:
-
hash(Hash) -- the hash to use to construct the instance.
def self.from_hash(hash) new Request.from_hash(hash.fetch('request', {})), Response.from_hash(hash.fetch('response', {})), Time.httpdate(hash.fetch('recorded_at')) end
def hook_aware
-
(HookAware)- an instance with additional capabilities
def hook_aware HookAware.new(self) end
def initialize(*args)
def initialize(*args) super self.recorded_at ||= Time.now end
def to_hash
- See: HTTPInteraction.from_hash -
Returns:
-
(Hash)- hash that represents this HTTP interaction
def to_hash { 'request' => request.to_hash, 'response' => response.to_hash, 'recorded_at' => recorded_at.httpdate } end