Class: Rack::Typhoeus::Middleware::ParamsDecoder
- Inherits:
-
Object
- Object
- Rack::Typhoeus::Middleware::ParamsDecoder
- Includes:
- Helper
- Defined in:
- lib/rack/typhoeus/middleware/params_decoder.rb,
lib/rack/typhoeus/middleware/params_decoder/helper.rb
Overview
This Rack middleware takes care of the proper deserialization of the nested params encoded by Typhoeus.
Defined Under Namespace
Modules: Helper
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ParamsDecoder
constructor
A new instance of ParamsDecoder.
Methods included from Helper
#decode, #decode!, #decode_typhoeus_arrays
Constructor Details
#initialize(app) ⇒ ParamsDecoder
Returns a new instance of ParamsDecoder.
26 27 28 |
# File 'lib/rack/typhoeus/middleware/params_decoder.rb', line 26 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
30 31 32 33 34 |
# File 'lib/rack/typhoeus/middleware/params_decoder.rb', line 30 def call(env) req = Rack::Request.new(env) decode(req.params).each_pair { |k, v| update_params req, k, v } @app.call(env) end |