class GoogleLogger::ParamsReplacer

Public Instance Methods

deep_replace_params_in_array(array) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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