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

#initialize(application) ⇒ Adapter

Returns a new instance of Adapter.

Parameters:



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

def initialize(application)
  @application = application
end

Instance Attribute Details

#applicationWebmachine::Application (readonly)

Returns the application

Returns:



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

#runObject

This method is abstract.

Subclass and override #run to implement a custom adapter.

Start the adapter.

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/webmachine/adapter.rb', line 23

def run
  raise NotImplementedError
end