Module: DataBindings::Adapters::Params
- Includes:
- Ruby
- Defined in:
- lib/data_bindings/adapters/params.rb
Defined Under Namespace
Modules: Convert
Instance Method Summary collapse
Methods included from Ruby
#from_ruby, #from_ruby_array, #from_ruby_hash
Instance Method Details
#from_params(str) ⇒ Object
8 9 10 |
# File 'lib/data_bindings/adapters/params.rb', line 8 def from_params(str) from_ruby( parse_nested_query(str) ) end |
#parse_nested_query(qs, d = nil) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/data_bindings/adapters/params.rb', line 13 def parse_nested_query(qs, d = nil) (qs || '').split(d ? /[#{d}] */n : /[&;] */n).inject({}) do |params, p| k, v = p.split('=', 2).map { |s| CGI::unescape(s) } normalize_params(params, k, v) end end |