Class: CommandTower::CredentialResolution::SmtpCredentials

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#passwordObject (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_nameObject (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

Returns:

  • (Boolean)


15
16
17
# File 'lib/command_tower/credential_resolution/smtp_credentials.rb', line 15

def available?
  user_name.present? && password.present?
end

#inspectObject 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