Module: BitBucket::Normalizer
- Included in:
- API
- Defined in:
- lib/bitbucket_rest_api/normalizer.rb
Overview
Deals with normalizing client supplied parameter keys.
Instance Method Summary collapse
-
#normalize!(params) ⇒ Object
Turns any keys from nested hashes including nested arrays into strings.
Instance Method Details
#normalize!(params) ⇒ Object
Turns any keys from nested hashes including nested arrays into strings
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bitbucket_rest_api/normalizer.rb', line 7 def normalize!(params) case params when Hash params.keys.each do |k| params[k.to_s] = params.delete(k) normalize!(params[k.to_s]) end when Array params.map! do |el| normalize!(el) end else params.to_s end params end |