Class: Zizq::Middleware::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/zizq/middleware.rb

Overview

A single link in the middleware chain, connecting a middleware to the next link (or terminal).

Instance Method Summary collapse

Constructor Details

#initialize(middleware, next_link) ⇒ Link

: (untyped, untyped) -> void



68
69
70
71
# File 'lib/zizq/middleware.rb', line 68

def initialize(middleware, next_link) #: (untyped, untyped) -> void
  @middleware = middleware
  @next_link = next_link
end

Instance Method Details

#call(arg) ⇒ Object

Invoke this middleware, passing the next link for continuation.



74
75
76
# File 'lib/zizq/middleware.rb', line 74

def call(arg) #: (untyped) -> untyped
  @middleware.call(arg, @next_link)
end