Class: MiddlewareStackTest::Handler

Inherits:
Struct
  • Object
show all
Defined in:
test/middleware_stack_test.rb

Overview

mock handler classes

Direct Known Subclasses

Apple, Banana, Orange, Strawberry

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app


5
6
7
# File 'test/middleware_stack_test.rb', line 5

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object


6
7
8
9
# File 'test/middleware_stack_test.rb', line 6

def call(env)
  (env[:request_headers]['X-Middleware'] ||= '') << ":#{self.class.name.split('::').last}"
  app.call(env)
end