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, &perform) ⇒ WebMockPerform

Returns a new instance of WebMockPerform.


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

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

Instance Method Details

#execObject


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

def exec
  replay || perform || halt
end

#request_signatureObject


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

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

  @request_signature
end