Class: VCR::Request

Inherits:
Struct
  • Object
show all
Defined in:
lib/vcr/structs.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



4
5
6
# File 'lib/vcr/structs.rb', line 4

def body
  @body
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



4
5
6
# File 'lib/vcr/structs.rb', line 4

def headers
  @headers
end

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



4
5
6
# File 'lib/vcr/structs.rb', line 4

def method
  @method
end

#uriObject

Returns the value of attribute uri

Returns:

  • (Object)

    the current value of uri



4
5
6
# File 'lib/vcr/structs.rb', line 4

def uri
  @uri
end

Class Method Details

.from_net_http_request(net_http, request) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/vcr/structs.rb', line 5

def self.from_net_http_request(net_http, request)
  new(
    request.method.downcase.to_sym,
    VCR.http_stubbing_adapter.request_uri(net_http, request),
    request.body,
    request.to_hash
  )
end