Class: Riot::AllImportantMiddleware
- Inherits:
-
ContextMiddleware
- Object
- ContextMiddleware
- Riot::AllImportantMiddleware
- 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
Instance Method Summary collapse
-
#call(context) ⇒ Object
The magic happens here.
-
#initialize(&context_definition) ⇒ AllImportantMiddleware
constructor
A new instance of AllImportantMiddleware.
Methods inherited from ContextMiddleware
Constructor Details
#initialize(&context_definition) ⇒ AllImportantMiddleware
Returns a new instance of AllImportantMiddleware.
97 98 99 |
# File 'lib/riot/middleware.rb', line 97 def initialize(&context_definition) @context_definition = context_definition end |
Instance Method Details
#call(context) ⇒ Object
The magic happens here. Because you have access to the Context, you can add your own setups, hookups, etc. call
will be called before any tests are run, but after the Context is configured. Though something will likely be returned, do not put any faith in what that will be.
102 |
# File 'lib/riot/middleware.rb', line 102 def call(context) context.instance_eval(&@context_definition); end |