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
# File 'lib/webmock/http_lib_adapters/http_rb/client.rb', line 5

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

  WebMockPerform.new(request, options) { __perform__(request, options) }.exec
end

#webmock_enabled?Boolean

Returns:

  • (Boolean)


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

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