Module: ActionDispatch::ParamBuilder
- Defined in:
- runtime/action_dispatch/param_builder.rb
Defined Under Namespace
Classes: Invalid
Constant Summary collapse
- DEPTH_LIMIT =
100
Class Method Summary collapse
-
.build(keys, values, present) ⇒ Hash
the nested params for the pairs.
-
.from_query_string(s) ⇒ Hash
a query string (or an urlencoded body) straight to the nested params.
Class Method Details
.build(keys, values, present) ⇒ Hash
the nested params for the pairs.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'runtime/action_dispatch/param_builder.rb', line 32 def self.build(keys, values, present) params = {} i = 0 while i < keys.length v = present[i] ? values[i] : nil store(params, keys[i], v, 0) i += 1 end params rescue ParamBuilder::Invalid nil end |
.from_query_string(s) ⇒ Hash
a query string (or an urlencoded body) straight to the nested params.
51 52 53 54 55 56 57 |
# File 'runtime/action_dispatch/param_builder.rb', line 51 def self.from_query_string(s) keys = [] values = [] present = [] return nil unless split(s, keys, values, present) ActionDispatch::ParamBuilder.build(keys, values, present) end |