Class: Mint::Secret
- Inherits:
-
Object
- Object
- Mint::Secret
- Defined in:
- src/mintpress-common/lib/mintpress-common/secret.rb
Overview
A class for holding a secret.
The primary purpose of this class is to prevent
a secret value (password, key etc.) from being accidentally
exposed in logging, debug, audit, etc.
Properties (Read/Write)
Properties (Read Only)
Instance Method Summary collapse
-
#initialize(secret_value) ⇒ Secret
constructor
Initialize a new secret with a given value.
-
#to_s ⇒ Object
(also: #inspect)
Simply return '********' during implicit type conversion.
-
#value ⇒ Object
Get the secret value.
Constructor Details
#initialize(secret_value) ⇒ Secret
Initialize a new secret with a given value.
value - anything you want to keep secret from loggers, etc.
Instance Method Details
#to_s ⇒ Object Also known as: inspect
Simply return '********' during implicit type conversion
#value ⇒ Object
Get the secret value.