Class: Rack::Chain::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/chain.rb

Instance Method Summary collapse

Constructor Details

#initialize(to) ⇒ Link

Returns a new instance of Link.



9
10
11
# File 'lib/rack/chain.rb', line 9

def initialize(to)
  @to = to
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
# File 'lib/rack/chain.rb', line 13

def call(env)
  Fiber.new do
    Fiber.yield @to.call(env)
  end.resume
end