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



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

alias_method :__perform__, :perform

#perform(request, options) ⇒ Object



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

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)


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

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