Module: Github::Normalizer

Included in:
API::Arguments, ParamsHash
Defined in:
lib/github_api/normalizer.rb

Overview

Normalize client-supplied parameter keys.

Instance Method Summary collapse

Instance Method Details

#normalize!(params) ⇒ Object

Turns any keys from nested hashes including nested arrays into strings



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/github_api/normalizer.rb', line 8

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
  end
  params
end
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy