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

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

Overview

A convenient wrapper to build obfuscators

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBuilder

Returns a new instance of Builder.

Raises:

  • (NotImplementedError)


107
108
109
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 107

def initialize
  raise NotImplementedError, "#{self.class.name} is not implemented."
end

Instance Attribute Details

#obfuscatorsObject

Returns the value of attribute obfuscators.



105
106
107
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 105

def obfuscators
  @obfuscators
end

Instance Method Details

#buildObject

Raises:

  • (NotImplementedError)


121
122
123
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 121

def build
  raise NotImplementedError, "#{self.class.name}#build() is not implemented."
end

#with_field(key) ⇒ Object



111
112
113
114
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 111

def with_field(key)
  @obfuscators[key] = ValueObfuscator.INSTANCE
  self
end

#with_sensitive_field(key) ⇒ Object



116
117
118
119
# File 'lib/onlinepayments/sdk/logging/logging_util.rb', line 116

def with_sensitive_field(key)
  @obfuscators[key] = SensitiveValueObfuscator.INSTANCE
  self
end