Class: HTTP::WebMockPerform

Inherits:
Object
  • Object
show all
Defined in:
lib/webmock/http_lib_adapters/http_rb/webmock.rb

Instance Method Summary collapse

Constructor Details

#initialize(request, options, &perform) ⇒ WebMockPerform

Returns a new instance of WebMockPerform.



5
6
7
8
9
10
# File 'lib/webmock/http_lib_adapters/http_rb/webmock.rb', line 5

def initialize(request, options, &perform)
  @request = request
  @options = options
  @perform = perform
  @request_signature = nil
end

Instance Method Details

#execObject



12
13
14
# File 'lib/webmock/http_lib_adapters/http_rb/webmock.rb', line 12

def exec
  replay || perform || halt
end

#request_signatureObject



16
17
18
19
20
21
22
23
# File 'lib/webmock/http_lib_adapters/http_rb/webmock.rb', line 16

def request_signature
  unless @request_signature
    @request_signature = @request.webmock_signature
    register_request(@request_signature)
  end

  @request_signature
end