Parent

Methods

Rack::Typhoeus::Middleware::ParamsDecoder

This Rack middleware takes care of the proper deserialization of the nested params encoded by Typhoeus.

@example Require the railtie when using Rails.

require 'typhoeus/railtie'

@example Include the middleware for Rack based applications.

use Rack::Typhoeus::Middleware::ParamsDecoder

@example Use the helper directly. Not recommended as b/c the interface might change.

require 'rack/typhoeus/middleware/params_decoder/helper'
include Rack::Typhoeus::Middleware::ParamsDecoder::Helper
decode!(params)

@author Dwayne Macgowan @since 0.5.4

Public Class Methods

new(app) click to toggle source
# File lib/rack/typhoeus/middleware/params_decoder.rb, line 26
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.