Class: Goliath::Rack::Params
- Inherits:
-
Object
- Object
- Goliath::Rack::Params
- Defined in:
- lib/goliath/rack/params.rb
Overview
A middle ware to parse params. This will parse both the query string parameters and the body and place them into the params hash of the Goliath::Env for the request.
Defined Under Namespace
Modules: Parser
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Params
constructor
A new instance of Params.
Methods included from Parser
Methods included from Validator
Constructor Details
#initialize(app) ⇒ Params
Returns a new instance of Params.
59 60 61 |
# File 'lib/goliath/rack/params.rb', line 59 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
63 64 65 66 67 68 |
# File 'lib/goliath/rack/params.rb', line 63 def call(env) Goliath::Rack::Validator.safely(env) do env['params'] = retrieve_params(env) @app.call(env) end end |