Class: Kamal::Utils::Sensitive

Inherits:
Object
  • Object
show all
Includes:
SSHKit::Redaction
Defined in:
lib/kamal/utils/sensitive.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, redaction: "[REDACTED]") ⇒ Sensitive

Returns a new instance of Sensitive.



12
13
14
# File 'lib/kamal/utils/sensitive.rb', line 12

def initialize(value, redaction: "[REDACTED]")
  @unredacted, @redaction = value, redaction
end

Instance Attribute Details

#redactionObject (readonly)

Returns the value of attribute redaction.



8
9
10
# File 'lib/kamal/utils/sensitive.rb', line 8

def redaction
  @redaction
end

#unredactedObject (readonly)

Returns the value of attribute unredacted.



8
9
10
# File 'lib/kamal/utils/sensitive.rb', line 8

def unredacted
  @unredacted
end

Instance Method Details

#encode_with(coder) ⇒ Object

Sensitive values won’t leak into YAML output.



17
18
19
# File 'lib/kamal/utils/sensitive.rb', line 17

def encode_with(coder)
  coder.represent_scalar nil, redaction
end