Class: Twilivery::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/twilivery.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



21
22
23
# File 'lib/twilivery.rb', line 21

def initialize
  set_defaults
end

Instance Attribute Details

#account_sidObject

Returns the value of attribute account_sid.



16
17
18
# File 'lib/twilivery.rb', line 16

def 
  @account_sid
end

#auth_tokenObject

Returns the value of attribute auth_token.



17
18
19
# File 'lib/twilivery.rb', line 17

def auth_token
  @auth_token
end

#default_country_codeObject

Returns the value of attribute default_country_code.



19
20
21
# File 'lib/twilivery.rb', line 19

def default_country_code
  @default_country_code
end

#default_sms_senderObject

Returns the value of attribute default_sms_sender.



18
19
20
# File 'lib/twilivery.rb', line 18

def default_sms_sender
  @default_sms_sender
end

Instance Method Details

#set_defaultsObject



25
26
27
28
29
30
# File 'lib/twilivery.rb', line 25

def set_defaults
  @account_sid = ENV.fetch('TWILIO_ACCOUNT_SID') { '' }
  @auth_token = ENV.fetch('TWILIO_AUTH_TOKEN') { nil }
  @default_sms_sender = ENV.fetch('TWILIO_SMS_SENDER') { nil }
  @default_country_code = ENV.fetch('TWILIO_COUNTRY_CODE') { nil }
end