Class: Mrsk::Utils::Sensitive
- Inherits:
-
Object
- Object
- Mrsk::Utils::Sensitive
- Includes:
- SSHKit::Redaction
- Defined in:
- lib/mrsk/utils/sensitive.rb
Instance Attribute Summary collapse
-
#redaction ⇒ Object
readonly
Returns the value of attribute redaction.
-
#unredacted ⇒ Object
readonly
Returns the value of attribute unredacted.
Instance Method Summary collapse
-
#encode_with(coder) ⇒ Object
Sensitive values won’t leak into YAML output.
-
#initialize(value, redaction: "[REDACTED]") ⇒ Sensitive
constructor
A new instance of Sensitive.
Constructor Details
#initialize(value, redaction: "[REDACTED]") ⇒ Sensitive
Returns a new instance of Sensitive.
11 12 13 |
# File 'lib/mrsk/utils/sensitive.rb', line 11 def initialize(value, redaction: "[REDACTED]") @unredacted, @redaction = value, redaction end |
Instance Attribute Details
#redaction ⇒ Object (readonly)
Returns the value of attribute redaction.
7 8 9 |
# File 'lib/mrsk/utils/sensitive.rb', line 7 def redaction @redaction end |
#unredacted ⇒ Object (readonly)
Returns the value of attribute unredacted.
7 8 9 |
# File 'lib/mrsk/utils/sensitive.rb', line 7 def unredacted @unredacted end |
Instance Method Details
#encode_with(coder) ⇒ Object
Sensitive values won’t leak into YAML output.
16 17 18 |
# File 'lib/mrsk/utils/sensitive.rb', line 16 def encode_with(coder) coder.represent_scalar nil, redaction end |