Class: Merb::Rack::Adapter
Class Method Summary collapse
-
.get(id) ⇒ Object
Get a rack adapter by id.
-
.register(ids, adapter_class) ⇒ Object
Registers a new Rack adapter.
Class Method Details
.get(id) ⇒ Object
Get a rack adapter by id.
Parameters
- id<String>
-
The identifier of the Rack adapter class to retrieve.
Returns.
- Class
-
The adapter class.
:api: private
16 17 18 19 20 21 22 |
# File 'lib/merb-core/rack/adapter.rb', line 16 def get(id) if @adapters[id.to_s] Object.full_const_get(@adapters[id.to_s]) else Merb.fatal! "The adapter #{id} did not exist" end end |
.register(ids, adapter_class) ⇒ Object
Registers a new Rack adapter.
Parameters
- ids<Array>
-
Identifiers by which this adapter is recognized by.
- adapter_class<Class>
-
The Rack adapter class.
:api: plugin
31 32 33 34 |
# File 'lib/merb-core/rack/adapter.rb', line 31 def register(ids, adapter_class) @adapters ||= Hash.new ids.each { |id| @adapters[id] = "Merb::Rack::#{adapter_class}" } end |