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.



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

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

Instance Method Details

#execObject



10
11
12
# File 'lib/webmock/http_lib_adapters/http_rb/webmock.rb', line 10

def exec
  replay || perform || halt
end

#request_signatureObject



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

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

  @request_signature
end