class MarkMapper::Middleware::IdentityMap
Usage:
config.middleware.insert_after \ ActionDispatch::Callbacks, MarkMapper::Middleware::IdentityMap
You have to insert after callbacks so the entire request is wrapped.
Public Class Methods
new(app)
click to toggle source
# File lib/mark_mapper/middleware/identity_map.rb, line 28 def initialize(app) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/mark_mapper/middleware/identity_map.rb, line 32 def call(env) MarkMapper::Plugins::IdentityMap.clear enabled = MarkMapper::Plugins::IdentityMap.enabled MarkMapper::Plugins::IdentityMap.enabled = true status, headers, body = @app.call(env) [status, headers, Body.new(body, enabled)] end