A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://rubydoc.info/github/piotrmurach/github/master/Github/Normalizer below:

Normalizer – Documentation for piotrmurach/github (master) – RubyDoc.info

Module: Github::Normalizer 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4