class Merb::Rack::Adapter
Public Class Methods
get(id)
click to toggle source
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
# 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)
click to toggle source
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
# 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