Class: Twi::Lio
- Inherits:
-
Object
- Object
- Twi::Lio
- Defined in:
- lib/twi/lio.rb
Overview
Provides an object to store global configuration settings.
This class is not used directly, but by calling Twi.configure, which creates and updates a single instance of Lio.
An alternative way to set global configuration settings is by storing them in the following environment variables:
-
TWILIO_SIDto store the Twilio SID -
TWILIO_SECRETto store the Twilio secret -
TWILIO_CONVERSATION_SERVICE_SIDto store the Twilio Conversation service ID
In case both methods are used together, Twi.configure takes precedence.
Instance Attribute Summary collapse
-
#conversation_service_sid ⇒ String
readonly
The SID of the default Conversation service to use.
-
#secret ⇒ String
readonly
The secret to interact with the Twilio API.
-
#sid ⇒ String
readonly
The SID to interact with the Twilio API.
Instance Method Summary collapse
-
#initialize ⇒ Lio
constructor
Initialize the global configuration settings defaulting to matching environment variables.
Constructor Details
#initialize ⇒ Lio
Initialize the global configuration settings defaulting to matching environment variables.
32 33 34 35 36 |
# File 'lib/twi/lio.rb', line 32 def initialize @sid = ENV['TWILIO_SID'] @secret = ENV['TWILIO_SECRET'] @conversation_service_sid = ENV['TWILIO_CONVERSATION_SERVICE_SID'] end |
Instance Attribute Details
#conversation_service_sid ⇒ String (readonly)
Returns the SID of the default Conversation service to use.
45 46 47 |
# File 'lib/twi/lio.rb', line 45 def conversation_service_sid @conversation_service_sid end |
#secret ⇒ String (readonly)
Returns the secret to interact with the Twilio API.
42 43 44 |
# File 'lib/twi/lio.rb', line 42 def secret @secret end |
#sid ⇒ String (readonly)
Returns the SID to interact with the Twilio API.
39 40 41 |
# File 'lib/twi/lio.rb', line 39 def sid @sid end |