Class: CemAcpt::Config::Secret

Inherits:
Object
  • Object
show all
Defined in:
lib/cem_acpt/config/base.rb

Overview

Provides a wrapper for secret values. This is used to prevent secrets from being printed in logs or error messages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ Secret

Returns a new instance of Secret.



21
22
23
24
# File 'lib/cem_acpt/config/base.rb', line 21

def initialize(key, value)
  @value = value
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



19
20
21
# File 'lib/cem_acpt/config/base.rb', line 19

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



19
20
21
# File 'lib/cem_acpt/config/base.rb', line 19

def value
  @value
end

Instance Method Details

#inspectObject



30
31
32
# File 'lib/cem_acpt/config/base.rb', line 30

def inspect
  "#<#{self.class}:#{object_id.to_s(16)} key=#{key} value=**** >"
end

#to_sObject



26
27
28
# File 'lib/cem_acpt/config/base.rb', line 26

def to_s
  "Secret(#{key}=****)"
end