Class: Datadog::Core::Transport::HTTP::Adapters::Registry
- Inherits:
-
Object
- Object
- Datadog::Core::Transport::HTTP::Adapters::Registry
- Defined in:
- lib/datadog/core/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.
10 11 12 |
# File 'lib/datadog/core/transport/http/adapters/registry.rb', line 10 def initialize @adapters = {} end |
Instance Method Details
#get(name) ⇒ Object
14 15 16 |
# File 'lib/datadog/core/transport/http/adapters/registry.rb', line 14 def get(name) @adapters[name] end |
#set(klass, name = nil) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/datadog/core/transport/http/adapters/registry.rb', line 18 def set(klass, name = nil) name ||= klass.to_s return if name.nil? @adapters[name] = klass end |