Class: Ramverk::Configuration::Middleware
- Inherits:
-
Object
- Object
- Ramverk::Configuration::Middleware
- Defined in:
- lib/ramverk/configuration/middleware.rb
Overview
Middleware manager.
Instance Attribute Summary collapse
-
#stack ⇒ Array
readonly
Return all registered middleware in the stack.
Instance Method Summary collapse
-
#append(middleware, *args, &block) ⇒ Object
(also: #use)
Append a middleware to the stack.
-
#prepend(middleware, *args, &block) ⇒ Object
Prepend a middleware to the stack.
- #run ⇒ Object
Instance Attribute Details
#stack ⇒ Array (readonly)
Return all registered middleware in the stack.
10 11 12 |
# File 'lib/ramverk/configuration/middleware.rb', line 10 def stack @stack end |
Instance Method Details
#append(middleware, *args, &block) ⇒ Object Also known as: use
Append a middleware to the stack.
22 23 24 |
# File 'lib/ramverk/configuration/middleware.rb', line 22 def append(middleware, *args, &block) @stack << [middleware, args, block].freeze end |
#prepend(middleware, *args, &block) ⇒ Object
Prepend a middleware to the stack.
32 33 34 |
# File 'lib/ramverk/configuration/middleware.rb', line 32 def prepend(middleware, *args, &block) @stack.unshift [middleware, args, block].freeze end |
#run ⇒ Object
36 37 38 |
# File 'lib/ramverk/configuration/middleware.rb', line 36 def run end |