Class: Webmachine::Adapter Abstract
- Inherits:
-
Object
- Object
- Webmachine::Adapter
- Defined in:
- lib/webmachine/adapter.rb
Overview
Subclass and override #run to implement a custom adapter.
The abstract class for definining a Webmachine adapter.
Direct Known Subclasses
Webmachine::Adapters::Mongrel, Webmachine::Adapters::Rack, Webmachine::Adapters::WEBrick
Instance Attribute Summary (collapse)
-
- (Webmachine::Configuration) configuration
readonly
The application's configuration.
-
- (Webmachine::Dispatcher) dispatcher
readonly
The application's dispatcher.
Class Method Summary (collapse)
-
+ (Object) run(configuration, dispatcher)
Create a new adapter and run it.
Instance Method Summary (collapse)
-
- (Adapter) initialize(configuration, dispatcher)
constructor
configuration.
-
- (Object) run
Abstract
Start the adapter.
Constructor Details
- (Adapter) initialize(configuration, dispatcher)
configuration.
17 18 19 20 |
# File 'lib/webmachine/adapter.rb', line 17 def initialize(configuration, dispatcher) @configuration = configuration @dispatcher = dispatcher end |
Instance Attribute Details
- (Webmachine::Configuration) configuration (readonly)
The application's configuration.
9 10 11 |
# File 'lib/webmachine/adapter.rb', line 9 def configuration @configuration end |
- (Webmachine::Dispatcher) dispatcher (readonly)
The application's dispatcher.
12 13 14 |
# File 'lib/webmachine/adapter.rb', line 12 def dispatcher @dispatcher end |
Class Method Details
+ (Object) run(configuration, dispatcher)
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
- (Object) run
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 |