Module: Roy::After
- Defined in:
- lib/roy/after.rb
Overview
This module allows you to modify the response before it is sent to the client. It does this by overriding the #call method.
Configuration:
- roy.conf.after
-
A proc object that will be called with the response as argument. Defaults to identity if not set.
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/roy/after.rb', line 29 def call(env) status, header, body = super resp = Rack::Response.new(body, status, header) (roy.conf.after || lambda {|x| x }).(resp) resp.finish end |