Class: Goliath::Rack::DefaultResponseFormat

Inherits:
Object
  • Object
show all
Includes:
AsyncMiddleware
Defined in:
lib/goliath/rack/default_response_format.rb

Instance Method Summary collapse

Methods included from AsyncMiddleware

#call, #final_response?, #hook_into_callback_chain, #initialize

Methods included from Validator

safely, validation_error

Instance Method Details

#post_process(env, status, headers, body) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/goliath/rack/default_response_format.rb', line 6

def post_process(env, status, headers, body)
  if body.is_a?(String)
    [status, headers, [body]]
  else
    [status, headers, body]
  end
end