Class: Webmachine::Adapter Abstract

Inherits:
Object
  • Object
show all
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.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Adapter) initialize(application)

Returns a new instance of Adapter

Parameters:



12
13
14
# File 'lib/webmachine/adapter.rb', line 12

def initialize(application)
  @application = application
end

Instance Attribute Details

- (Webmachine::Application) application (readonly)

Returns the application

Returns:



9
10
11
# File 'lib/webmachine/adapter.rb', line 9

def application
  @application
end

Class Method Details

+ (Object) run(application)

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

- (Object) run

This method is abstract.

Subclass and override #run to implement a custom adapter.

Start the adapter.

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/webmachine/adapter.rb', line 25

def run
  raise NotImplementedError
end