Movatterモバイル変換


[0]ホーム

URL:


Libraries »piotrmurach/github(master) »Index (P) »Github »ParameterFilter

Module: Github::ParameterFilter

Included in:
API::Arguments
Defined in:
lib/github_api/parameter_filter.rb

Overview

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.

Instance Method Summarycollapse

Instance Method Details

#filter!(keys, params, options = {:recursive => true}) ⇒Object

Removes any keys from nested hashes that don’t match predefiend keys

14151617181920212223242526272829303132
# File 'lib/github_api/parameter_filter.rb', line 14deffilter!(keys,params,options={: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])ifoptions[:recursive]endendwhenArrayparams.map!do|el|filter!(keys,el)ifoptions[:recursive]endelseparamsendreturnparamsend
Generated on Sun Nov 30 00:00:08 2025 byyard 0.9.37 (ruby-3.4.3).

[8]ページ先頭

©2009-2025 Movatter.jp