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)

Returns:
  • (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

Returns:
  • (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

Other tags:
    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