Class: CommandTower::CredentialResolution::SmtpCredentials
- Inherits:
-
Object
- Object
- CommandTower::CredentialResolution::SmtpCredentials
- Defined in:
- lib/command_tower/credential_resolution/smtp_credentials.rb
Overview
Typed SMTP deployment credentials. Never log or serialize raw values.
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#user_name ⇒ Object
readonly
Returns the value of attribute user_name.
Instance Method Summary collapse
- #available? ⇒ Boolean
-
#initialize(user_name:, password:) ⇒ SmtpCredentials
constructor
A new instance of SmtpCredentials.
- #inspect ⇒ Object (also: #pretty_inspect)
Constructor Details
#initialize(user_name:, password:) ⇒ SmtpCredentials
Returns a new instance of SmtpCredentials.
9 10 11 12 13 |
# File 'lib/command_tower/credential_resolution/smtp_credentials.rb', line 9 def initialize(user_name:, password:) @user_name = user_name.to_s.strip @password = password.to_s.strip freeze end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
7 8 9 |
# File 'lib/command_tower/credential_resolution/smtp_credentials.rb', line 7 def password @password end |
#user_name ⇒ Object (readonly)
Returns the value of attribute user_name.
7 8 9 |
# File 'lib/command_tower/credential_resolution/smtp_credentials.rb', line 7 def user_name @user_name end |
Instance Method Details
#available? ⇒ Boolean
15 16 17 |
# File 'lib/command_tower/credential_resolution/smtp_credentials.rb', line 15 def available? user_name.present? && password.present? end |
#inspect ⇒ Object Also known as: pretty_inspect
19 20 21 |
# File 'lib/command_tower/credential_resolution/smtp_credentials.rb', line 19 def inspect "#<#{self.class.name} user_name=[REDACTED] password=[REDACTED] available?=#{available?}>" end |