Class: Sms::Method::Twilio
- Inherits:
-
Object
- Object
- Sms::Method::Twilio
- Defined in:
- lib/sms/method/twilio.rb
Overview
POST /2010-04-01/Accounts//SMS/Messages.json with From, To, Body
Instance Method Summary collapse
- #deliver!(sms) ⇒ Object
-
#initialize(account_sid, auth_token, default_from = nil) ⇒ Twilio
constructor
A new instance of Twilio.
Constructor Details
#initialize(account_sid, auth_token, default_from = nil) ⇒ Twilio
Returns a new instance of Twilio.
9 10 11 12 13 |
# File 'lib/sms/method/twilio.rb', line 9 def initialize(account_sid, auth_token, default_from = nil) @account_sid = account_sid @auth_token = auth_token @from = default_from end |
Instance Method Details
#deliver!(sms) ⇒ Object
16 17 18 19 |
# File 'lib/sms/method/twilio.rb', line 16 def deliver!(sms) from = sms.from || @from client.account..create(from: from, to: sms.to, body: sms.text) end |