Allows you to specify parameters keys which will be preserved in parameters hash and its subhashes. Any keys from the nested hash that do not match will be removed.
Removes any keys from nested hashes that don’t match predefiend keys.
Removes any keys from nested hashes that don’t match predefiend keys
14151617181920212223242526272829303132 | # File 'lib/github_api/parameter_filter.rb', line 14deffilter!(keys,params,={:recursive=>true})# :nodoc:caseparamswhenHash,ParamsHashparams.keys.eachdo|k,v|unless(keys.include?(k)orGithub::Validations::VALID_API_KEYS.include?(k))params.delete(k)elsefilter!(keys,params[k])if[:recursive]endendwhenArrayparams.map!do|el|filter!(keys,el)if[:recursive]endelseparamsendreturnparamsend |