Class: Ingenico::Direct::SDK::Logging::Obfuscator

Inherits:
Object
  • Object
show all
Defined in:
lib/ingenico/direct/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)


50
51
52
53
# File 'lib/ingenico/direct/sdk/logging/logging_util.rb', line 50

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



87
88
89
90
91
92
93
94
# File 'lib/ingenico/direct/sdk/logging/logging_util.rb', line 87

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