Method: Tap::App#reset

Defined in:
lib/tap/app.rb

#resetObject

Clears objects, the queue, and resets the stack so that no middleware is used. Reset raises an error unless state is READY.



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/tap/app.rb', line 445

def reset
  synchronize do
    unless state == State::READY
      raise "cannot reset unless READY"
    end
    
    # walk up middleware to find the base of the stack

    while @stack.respond_to?(:stack)
      @stack = @stack.stack
    end
    
    objects.clear
    queue.clear
  end
  self
end