Class: HTTP::Client

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

Instance Method Summary collapse

Instance Method Details

#__perform__Object


3
# File 'lib/webmock/http_lib_adapters/http_rb/client.rb', line 3

alias_method :__perform__, :perform

#perform(request, options) ⇒ Object


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

def perform(request, options)
  return __perform__(request, options) unless webmock_enabled?

  response = WebMockPerform.new(request) { __perform__(request, options) }.exec
  options.features.each { |_name, feature| response = feature.wrap_response(response) }
  response
end

#webmock_enabled?Boolean

Returns:

  • (Boolean)

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

def webmock_enabled?
  ::WebMock::HttpLibAdapters::HttpRbAdapter.enabled?
end