Module: Rack::Typhoeus::Middleware::ParamsDecoder::Helper
- Included in:
- Rack::Typhoeus::Middleware::ParamsDecoder
- Defined in:
- lib/rack/typhoeus/middleware/params_decoder/helper.rb
Overview
Instance Method Summary collapse
- #decode(hash) ⇒ Object
-
#decode!(hash) ⇒ Hash
Recursively decodes Typhoeus encoded arrays in given Hash.
-
#decode_typhoeus_arrays ⇒ Object
Recursively decodes Typhoeus encoded arrays in given Hash.
Instance Method Details
#decode(hash) ⇒ Object
36 37 38 |
# File 'lib/rack/typhoeus/middleware/params_decoder/helper.rb', line 36 def decode(hash) decode!(hash.dup) end |
#decode!(hash) ⇒ Hash
Recursively decodes Typhoeus encoded arrays in given Hash.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rack/typhoeus/middleware/params_decoder/helper.rb', line 25 def decode!(hash) return hash unless hash.is_a?(Hash) hash.each_pair do |key,value| if value.is_a?(Hash) decode!(value) hash[key] = convert(value) end end hash end |
#decode_typhoeus_arrays ⇒ Object
Recursively decodes Typhoeus encoded arrays in given Hash.
16 17 18 |
# File 'lib/rack/typhoeus/middleware/params_decoder/helper.rb', line 16 def decode_typhoeus_arrays decode!(params) end |