Class: OnlinePayments::SDK::Logging::SensitiveValueObfuscator

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

Overview

Class responsible for obfuscating sensitive data.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.INSTANCEObject



41
42
43
44
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 41

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.



47
48
49
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 47

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