Class: Pling::Middleware::Base
- Inherits:
-
Object
- Object
- Pling::Middleware::Base
- Includes:
- Configurable
- Defined in:
- lib/pling/middleware/base.rb
Overview
This is the base class to implement custom middleware for pling.
Middleware should inherit from this base class and implement a #deliver method. To call the next middleware on the stack this method must yield passing the given message and device.
Instance Method Summary collapse
-
#deliver(message, device) {|message, device| ... } ⇒ Object
Processes the given message and device and passes it to the next middleware on the stack.
-
#initialize(configuration = {}) ⇒ Base
constructor
Initializes a new middleware instance.
Constructor Details
#initialize(configuration = {}) ⇒ Base
Initializes a new middleware instance
32 33 34 |
# File 'lib/pling/middleware/base.rb', line 32 def initialize(configuration = {}) setup_configuration(configuration) end |
Instance Method Details
#deliver(message, device) {|message, device| ... } ⇒ Object
Processes the given message and device and passes it to the next middleware on the stack.
41 42 43 |
# File 'lib/pling/middleware/base.rb', line 41 def deliver(, device) yield(, device) end |