Class: Ingenico::Direct::SDK::Logging::SensitiveValueObfuscator

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

Overview

Class responsible for obfuscating sensitive data.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.INSTANCEObject



38
39
40
41
# File 'lib/ingenico/direct/sdk/logging/logging_util.rb', line 38

def self.INSTANCE
  # use lazy instantiation
  @@INSTANCE ||= SensitiveValueObfuscator.new
end

Instance Method Details

#obfuscate_value(value) ⇒ Object

Returns an arbitrary number of ‘*’, or null/empty if the value is null/empty.

Returns:

  • an arbitrary number of ‘*’, or null/empty if the value is null/empty.



44
45
46
# File 'lib/ingenico/direct/sdk/logging/logging_util.rb', line 44

def obfuscate_value(value)
  value.nil? or value.empty? ? value : "***"
end