Class: OnlinePayments::SDK::Logging::Obfuscator

Inherits:
Object
  • Object
show all
Defined in:
lib/onlinepayments/sdk/logging/logging_util.rb

Overview

end of SensitiveValueObfuscator

Direct Known Subclasses

HeaderObfuscator, PropertyObfuscator

Defined Under Namespace

Classes: Builder, HashClod

Instance Method Summary collapse

Constructor Details

#initialize(obfuscators, case_insensitive) ⇒ Obfuscator

Returns a new instance of Obfuscator.

Raises:

  • (ArgumentError)


55
56
57
58
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 55

def initialize(obfuscators, case_insensitive)
  raise ArgumentError unless obfuscators.is_a? Hash
  @obfuscators = copy(obfuscators, case_insensitive)
end

Instance Method Details

#obfuscate_value(key, value) ⇒ Object



94
95
96
97
98
99
100
101
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 94

def obfuscate_value(key, value)
  obfuscator = @obfuscators[key]
  if obfuscator.nil?
    value
  else
    obfuscator.obfuscate_value(value)
  end
end