Class: Datadog::Transport::HTTP::Adapters::Registry
- Inherits:
-
Object
- Object
- Datadog::Transport::HTTP::Adapters::Registry
- Defined in:
- lib/ddtrace/transport/http/adapters/registry.rb
Overview
List of available adapters
Instance Method Summary collapse
- #get(name) ⇒ Object
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #set(klass, name = nil) ⇒ Object
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
7 8 9 |
# File 'lib/ddtrace/transport/http/adapters/registry.rb', line 7 def initialize @adapters = {} end |
Instance Method Details
#get(name) ⇒ Object
11 12 13 |
# File 'lib/ddtrace/transport/http/adapters/registry.rb', line 11 def get(name) @adapters[name] end |
#set(klass, name = nil) ⇒ Object
15 16 17 18 19 |
# File 'lib/ddtrace/transport/http/adapters/registry.rb', line 15 def set(klass, name = nil) name ||= klass.to_s return if name.nil? @adapters[name] = klass end |