Class: Namira::Middleware::Responder

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

Overview

Builds the Response from the backend responses

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Responder

Returns a new instance of Responder.



6
7
8
# File 'lib/namira/middleware/responder.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object

Called by the middleware runner.

Parameters:



14
15
16
17
18
# File 'lib/namira/middleware/responder.rb', line 14

def call(env)
  handle_response(env.response)
  env.response = Namira::Response.new(env.response)
  @app.call(env)
end