Class: Smess::Twilio
- Includes:
- Logging
- Defined in:
- lib/smess/outputs/twilio.rb
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#callback_url ⇒ Object
Returns the value of attribute callback_url.
-
#from ⇒ Object
Returns the value of attribute from.
-
#messaging_service_sid ⇒ Object
Returns the value of attribute messaging_service_sid.
-
#sid ⇒ Object
Returns the value of attribute sid.
Attributes inherited from Output
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(config) ⇒ Twilio
constructor
A new instance of Twilio.
- #validate_config ⇒ Object
Methods included from Logging
Constructor Details
#initialize(config) ⇒ Twilio
Returns a new instance of Twilio.
7 8 9 10 |
# File 'lib/smess/outputs/twilio.rb', line 7 def initialize(config) super @results = [] end |
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
12 13 14 |
# File 'lib/smess/outputs/twilio.rb', line 12 def auth_token @auth_token end |
#callback_url ⇒ Object
Returns the value of attribute callback_url.
12 13 14 |
# File 'lib/smess/outputs/twilio.rb', line 12 def callback_url @callback_url end |
#from ⇒ Object
Returns the value of attribute from.
12 13 14 |
# File 'lib/smess/outputs/twilio.rb', line 12 def from @from end |
#messaging_service_sid ⇒ Object
Returns the value of attribute messaging_service_sid.
12 13 14 |
# File 'lib/smess/outputs/twilio.rb', line 12 def messaging_service_sid @messaging_service_sid end |
#sid ⇒ Object
Returns the value of attribute sid.
12 13 14 |
# File 'lib/smess/outputs/twilio.rb', line 12 def sid @sid end |
Instance Method Details
#deliver ⇒ Object
21 22 23 |
# File 'lib/smess/outputs/twilio.rb', line 21 def deliver send_one_sms sms..strip_nongsm_chars end |
#validate_config ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/smess/outputs/twilio.rb', line 13 def validate_config @sid = config.fetch(:sid) @auth_token = config.fetch(:auth_token) @from = config.fetch(:from, nil) @messaging_service_sid = config.fetch(:messaging_service_sid, nil) @callback_url = config.fetch(:callback_url) end |