Class: WebMock::HttpLibAdapterRegistry

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHttpLibAdapterRegistry

Returns a new instance of HttpLibAdapterRegistry.



7
8
9
# File 'lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb', line 7

def initialize
  @http_lib_adapters = {}
end

Instance Attribute Details

#http_lib_adaptersObject

Returns the value of attribute http_lib_adapters.



5
6
7
# File 'lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb', line 5

def http_lib_adapters
  @http_lib_adapters
end

Instance Method Details

#each_adapter(&block) ⇒ Object



15
16
17
# File 'lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb', line 15

def each_adapter(&block)
  @http_lib_adapters.each(&block)
end

#register(lib, adapter) ⇒ Object



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

def register(lib, adapter)
  @http_lib_adapters[lib] = adapter
end