File: http_lib_adapter_registry.rb

package info (click to toggle)
ruby-webmock 3.26.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,196 kB
  • sloc: ruby: 12,905; makefile: 6
file content (21 lines) | stat: -rw-r--r-- 360 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module WebMock
  class HttpLibAdapterRegistry
    include Singleton

    attr_accessor :http_lib_adapters

    def initialize
      @http_lib_adapters = {}
    end

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

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