Class: Redirector::Middleware::Responder
- Inherits:
-
Object
- Object
- Redirector::Middleware::Responder
- Defined in:
- lib/redirector/middleware.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
-
#initialize(application, environment) ⇒ Responder
constructor
A new instance of Responder.
- #response ⇒ Object
Constructor Details
#initialize(application, environment) ⇒ Responder
Returns a new instance of Responder.
16 17 18 19 |
# File 'lib/redirector/middleware.rb', line 16 def initialize(application, environment) @app = application @env = environment end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
14 15 16 |
# File 'lib/redirector/middleware.rb', line 14 def app @app end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
14 15 16 |
# File 'lib/redirector/middleware.rb', line 14 def env @env end |
Instance Method Details
#response ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/redirector/middleware.rb', line 21 def response if redirect? redirect_response else app.call(env) end end |