Class: Ingenico::Direct::SDK::Logging::ValueObfuscator

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

Overview

Class responsible for obfuscating sensitive data in a message body.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.INSTANCEObject



16
17
18
19
# File 'lib/ingenico/direct/sdk/logging/logging_util.rb', line 16

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

Instance Method Details

#obfuscate_value(value) ⇒ Object

Obfuscates the parameter value.



22
23
24
# File 'lib/ingenico/direct/sdk/logging/logging_util.rb', line 22

def obfuscate_value(value)
  (value.nil? or value.empty?) ? value : "*#{value.length}"
end