Class Tap::Middleware
In: lib/tap/middleware.rb
Parent: App::Api

Methods

app   build   call   new  

Attributes

stack  [R]  The call stack.

Public Class methods

[Source]

   # File lib/tap/middleware.rb, line 6
6:       def build(spec={}, app=Tap::App.current)
7:         new(app.stack, spec['config'] || {})
8:       end

[Source]

    # File lib/tap/middleware.rb, line 14
14:     def initialize(stack, config={})
15:       @stack = stack
16:       initialize_config(config)
17:     end

Public Instance methods

Returns the app at the base of the stack.

[Source]

    # File lib/tap/middleware.rb, line 20
20:     def app
21:       @app ||= begin
22:         current = stack
23:         until current.kind_of?(App::Stack)
24:           current = current.stack
25:         end
26:         current.app
27:       end
28:     end

By default call simply calls stack with the task and inputs.

[Source]

    # File lib/tap/middleware.rb, line 31
31:     def call(task, input)
32:       stack.call(task, input)
33:     end

[Validate]