Class: Riot::AllImportantMiddleware

Inherits:
ContextMiddleware show all
Defined in:
lib/riot/middleware.rb

Overview

Special middleware used by Context directly. It will always be the last in the chain and is the actual place where the user’s runtime context is processed.

Instance Attribute Summary

Attributes inherited from ContextMiddleware

#middleware

Instance Method Summary collapse

Methods inherited from ContextMiddleware

register

Constructor Details

#initialize(&context_definition) ⇒ AllImportantMiddleware

Returns a new instance of AllImportantMiddleware.



33
34
35
# File 'lib/riot/middleware.rb', line 33

def initialize(&context_definition)
  @context_definition = context_definition
end

Instance Method Details

#call(context) ⇒ Object



37
# File 'lib/riot/middleware.rb', line 37

def call(context) context.instance_eval(&@context_definition); end