Class: CommandTower::CredentialResolution::TwilioCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/command_tower/credential_resolution/twilio_credentials.rb

Overview

Typed Twilio deployment credentials. Never log or serialize raw values.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_sid:, auth_token:) ⇒ TwilioCredentials

Returns a new instance of TwilioCredentials.



9
10
11
12
13
# File 'lib/command_tower/credential_resolution/twilio_credentials.rb', line 9

def initialize(account_sid:, auth_token:)
  @account_sid = .to_s.strip
  @auth_token = auth_token.to_s.strip
  freeze
end

Instance Attribute Details

#account_sidObject (readonly)

Returns the value of attribute account_sid.



7
8
9
# File 'lib/command_tower/credential_resolution/twilio_credentials.rb', line 7

def 
  @account_sid
end

#auth_tokenObject (readonly)

Returns the value of attribute auth_token.



7
8
9
# File 'lib/command_tower/credential_resolution/twilio_credentials.rb', line 7

def auth_token
  @auth_token
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


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

def available?
  .present? && auth_token.present?
end

#inspectObject Also known as: pretty_inspect



19
20
21
# File 'lib/command_tower/credential_resolution/twilio_credentials.rb', line 19

def inspect
  "#<#{self.class.name} account_sid=[REDACTED] auth_token=[REDACTED] available?=#{available?}>"
end