Class: GoogleLogger::ParamsReplacer
- Inherits:
-
Object
- Object
- GoogleLogger::ParamsReplacer
- Defined in:
- lib/google_logger/params_replacer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #deep_replace_params_in_array(array) ⇒ Object
- #deep_replace_params_in_hash(hash) ⇒ Object
- #deep_replace_secret_params(arg) ⇒ Object
Class Method Details
.deep_replace_secret_params(params) ⇒ Object
29 30 31 |
# File 'lib/google_logger/params_replacer.rb', line 29 def deep_replace_secret_params(params) new.deep_replace_secret_params(params) end |
Instance Method Details
#deep_replace_params_in_array(array) ⇒ Object
24 25 26 |
# File 'lib/google_logger/params_replacer.rb', line 24 def deep_replace_params_in_array(array) array.each { |item| deep_replace_secret_params(item) } end |
#deep_replace_params_in_hash(hash) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/google_logger/params_replacer.rb', line 14 def deep_replace_params_in_hash(hash) hash.each do |key, value| if GoogleLogger.configuration.secret_params.include?(key.to_sym) hash[key] = GoogleLogger.configuration.secret_param_value else deep_replace_secret_params(value) end end end |
#deep_replace_secret_params(arg) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/google_logger/params_replacer.rb', line 5 def deep_replace_secret_params(arg) case arg when Hash deep_replace_params_in_hash(arg) when Array deep_replace_params_in_array(arg) end end |