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
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.
10 11 12 |
# File 'lib/webmachine/adapter.rb', line 10 def initialize(application) @application = application end |
Instance Attribute Details
#application ⇒ Webmachine::Application (readonly)
Returns the application
7 8 9 |
# File 'lib/webmachine/adapter.rb', line 7 def application @application end |
Class Method Details
.run(application) ⇒ Object
Create a new adapter and run it.
15 16 17 |
# File 'lib/webmachine/adapter.rb', line 15 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.
23 24 25 |
# File 'lib/webmachine/adapter.rb', line 23 def run raise NotImplementedError end |