Class: Sparrow::ResponseMiddleware

Inherits:
Middleware show all
Defined in:
lib/sparrow/response_middleware.rb

Overview

Handles the Response conversion

Instance Attribute Summary

Attributes inherited from Middleware

#app, #body, #headers, #ignored_response_codes, #status

Instance Method Summary collapse

Methods inherited from Middleware

#convert, #initialize

Constructor Details

This class inherits a constructor from Sparrow::Middleware

Instance Method Details

#call(env) ⇒ Array<String, Hash, Array<String>>

This call ends the rack chain

Parameters:

  • env (Hash)

    the Rack environment

Returns:

  • (Array<String, Hash, Array<String>>)

    the Rack return Array



9
10
11
12
13
# File 'lib/sparrow/response_middleware.rb', line 9

def call(env)
  @last_env                = env
  @status, @headers, @body = app.call(env)
  [status, headers, converted_response_body]
end