Class: Webmachine::Adapter Abstract
- Inherits:
-
Object
- Object
- Webmachine::Adapter
- Defined in:
- lib/webmachine/adapter.rb
Overview
This class is abstract.
Subclass and override #run to implement a custom adapter.
The abstract class for definining a Webmachine adapter.
Direct Known Subclasses
Webmachine::Adapters::Hatetepe, Webmachine::Adapters::Mongrel, Webmachine::Adapters::Rack, Webmachine::Adapters::Reel, Webmachine::Adapters::WEBrick
Instance Attribute Summary collapse
-
#configuration ⇒ Webmachine::Configuration
readonly
The application’s configuration.
-
#dispatcher ⇒ Webmachine::Dispatcher
readonly
The application’s dispatcher.
Class Method Summary collapse
-
.run(configuration, dispatcher) ⇒ Object
Create a new adapter and run it.
Instance Method Summary collapse
-
#initialize(configuration, dispatcher) ⇒ Adapter
constructor
configuration.
-
#run ⇒ Object
abstract
Start the adapter.
Constructor Details
#initialize(configuration, dispatcher) ⇒ Adapter
configuration.
17 18 19 20 |
# File 'lib/webmachine/adapter.rb', line 17 def initialize(configuration, dispatcher) @configuration = configuration @dispatcher = dispatcher end |
Instance Attribute Details
#configuration ⇒ Webmachine::Configuration (readonly)
Returns the application’s configuration.
9 10 11 |
# File 'lib/webmachine/adapter.rb', line 9 def configuration @configuration end |
#dispatcher ⇒ Webmachine::Dispatcher (readonly)
Returns the application’s dispatcher.
12 13 14 |
# File 'lib/webmachine/adapter.rb', line 12 def dispatcher @dispatcher end |
Class Method Details
.run(configuration, dispatcher) ⇒ Object
Create a new adapter and run it.
23 24 25 |
# File 'lib/webmachine/adapter.rb', line 23 def self.run(configuration, dispatcher) new(configuration, dispatcher).run end |
Instance Method Details
#run ⇒ Object
This method is abstract.
Subclass and override #run to implement a custom adapter.
Start the adapter.
31 32 33 |
# File 'lib/webmachine/adapter.rb', line 31 def run raise NotImplementedError end |