Sha256: b1ab92d54a8cb6c37482ef03891f013b747c01810e9de39cd01eb5668e061fc9

Contents?: true

Size: 603 Bytes

Versions: 21

Compression:

Stored size: 603 Bytes

Contents

module Github
  class ParamsHash < ::Hash

    def initialize(*args, &block)
      hash = args.extract_options!
      debugger
      # debugger
      # normalize_keys!(hash)
      # debugger
      super[hash]
    end

    def normalize_keys!(params)
      case params
      when Hash
        params.keys.each do |k|
          params[k.to_s] = params.delete(k)
          normalize_keys!(params[k.to_s])
        end
      when Array
        params.map! do |el|
          normalize_keys!(el)
        end
      else
        params.to_s
      end
      return params
    end

  end # ParamsHash
end # Github

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
github_api-0.8.11 lib/github_api/params_hash.rb
github_api-0.8.10 lib/github_api/params_hash.rb
github_api-0.8.9 lib/github_api/params_hash.rb
github_api-0.8.8 lib/github_api/params_hash.rb
github_api-0.8.7 lib/github_api/params_hash.rb
github_api-0.8.6 lib/github_api/params_hash.rb
github_api-0.8.5 lib/github_api/params_hash.rb
github_api-0.8.4 lib/github_api/params_hash.rb
github_api-0.8.3 lib/github_api/params_hash.rb
github_api-0.8.2 lib/github_api/params_hash.rb
github_api-0.8.1 lib/github_api/params_hash.rb
github_api-0.8.0 lib/github_api/params_hash.rb
github_api-0.7.2 lib/github_api/params_hash.rb
github_api-0.7.1 lib/github_api/params_hash.rb
github_api-0.7.0 lib/github_api/params_hash.rb
github_api-0.6.5 lib/github_api/params_hash.rb
github_api-0.6.4 lib/github_api/params_hash.rb
github_api-0.6.3 lib/github_api/params_hash.rb
github_api-0.6.2 lib/github_api/params_hash.rb
github_api-0.6.1 lib/github_api/params_hash.rb