Sha256: ec50f86308f9833eedf9e84c832eb0d83b974bfabd2474cc5e69439f582ef76a

Contents?: true

Size: 564 Bytes

Versions: 15

Compression:

Stored size: 564 Bytes

Contents

# encoding: utf-8

module Github
  # Deals with normalazing client supplied parameter keys.
  module Normalizer
    # Turns any keys from nested hashes including nested arrays into strings
    #
    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
      return params
    end
  end # Normalizer
end # Github

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
github_api-0.16.0 lib/github_api/normalizer.rb
github_api-0.15.0 lib/github_api/normalizer.rb
github_api-0.14.5 lib/github_api/normalizer.rb
github_api-0.14.4 lib/github_api/normalizer.rb
github_api-0.14.3 lib/github_api/normalizer.rb
github_api-0.14.2 lib/github_api/normalizer.rb
github_api-0.14.1 lib/github_api/normalizer.rb
github_api-0.14.0 lib/github_api/normalizer.rb
github_api-0.13.1 lib/github_api/normalizer.rb
github_api-0.13.0 lib/github_api/normalizer.rb
github_api-0.12.4 lib/github_api/normalizer.rb
github_api-0.12.3 lib/github_api/normalizer.rb
github_api-0.12.2 lib/github_api/normalizer.rb
github_api-0.12.1 lib/github_api/normalizer.rb
github_api-0.12.0 lib/github_api/normalizer.rb