Class: Nab::AdapterManager
- Inherits:
-
Object
- Object
- Nab::AdapterManager
- Defined in:
- lib/nab/adapter_manager.rb
Instance Method Summary collapse
- #get(type) ⇒ Object
-
#initialize ⇒ AdapterManager
constructor
A new instance of AdapterManager.
Constructor Details
#initialize ⇒ AdapterManager
Returns a new instance of AdapterManager.
6 7 8 |
# File 'lib/nab/adapter_manager.rb', line 6 def initialize @adapters = Hash.new end |
Instance Method Details
#get(type) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/nab/adapter_manager.rb', line 10 def get(type) if @adapters.key? type @adapters[type] else Log.debug "Loading adapter for #{type}" klass = Nab.const_get "#{type}Adapter" @adapters[type] = klass.new end end |