Class: Minitext::TwilioGateway
- Inherits:
-
Object
- Object
- Minitext::TwilioGateway
- Defined in:
- lib/minitext/twilio_gateway.rb
Instance Attribute Summary collapse
-
#account_sid ⇒ Object
readonly
Returns the value of attribute account_sid.
-
#auth_token ⇒ Object
readonly
Returns the value of attribute auth_token.
Instance Method Summary collapse
- #deliver(message) ⇒ Object
-
#initialize(account_sid:, auth_token:) ⇒ TwilioGateway
constructor
A new instance of TwilioGateway.
Constructor Details
#initialize(account_sid:, auth_token:) ⇒ TwilioGateway
Returns a new instance of TwilioGateway.
7 8 9 10 |
# File 'lib/minitext/twilio_gateway.rb', line 7 def initialize(account_sid:, auth_token:) @account_sid = account_sid @auth_token = auth_token end |
Instance Attribute Details
#account_sid ⇒ Object (readonly)
Returns the value of attribute account_sid.
5 6 7 |
# File 'lib/minitext/twilio_gateway.rb', line 5 def account_sid @account_sid end |
#auth_token ⇒ Object (readonly)
Returns the value of attribute auth_token.
5 6 7 |
# File 'lib/minitext/twilio_gateway.rb', line 5 def auth_token @auth_token end |
Instance Method Details
#deliver(message) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/minitext/twilio_gateway.rb', line 12 def deliver() params = { messaging_service_sid: .messaging_service_sid, from: .from, to: .to, body: .body.strip, media_url: .media_url, }.compact client..create(**params) end |