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::HTTPkit, Webmachine::Adapters::Rack, Webmachine::Adapters::Reel, Webmachine::Adapters::WEBrick
Instance Attribute Summary collapse
-
#application ⇒ Webmachine::Application
readonly
Returns the application.
Class Method Summary collapse
-
.run(application) ⇒ Object
Create a new adapter and run it.
Instance Method Summary collapse
-
#initialize(application) ⇒ Adapter
constructor
A new instance of Adapter.
-
#run ⇒ Object
abstract
Start the adapter.
Constructor Details
#initialize(application) ⇒ Adapter
Returns a new instance of Adapter.
12 13 14 |
# File 'lib/webmachine/adapter.rb', line 12 def initialize(application) @application = application end |
Instance Attribute Details
#application ⇒ Webmachine::Application (readonly)
Returns the application
9 10 11 |
# File 'lib/webmachine/adapter.rb', line 9 def application @application end |
Class Method Details
.run(application) ⇒ Object
Create a new adapter and run it.
17 18 19 |
# File 'lib/webmachine/adapter.rb', line 17 def self.run(application) new(application).run end |
Instance Method Details
#run ⇒ Object
This method is abstract.
Subclass and override #run to implement a custom adapter.
Start the adapter.
25 26 27 |
# File 'lib/webmachine/adapter.rb', line 25 def run raise NotImplementedError end |