Class: AiNoto::Message
- Inherits:
-
Object
- Object
- AiNoto::Message
- Defined in:
- lib/ai_noto.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#recipient ⇒ Object
Returns the value of attribute recipient.
-
#twilio_client ⇒ Object
Returns the value of attribute twilio_client.
Instance Method Summary collapse
-
#initialize(contents, twilio_client, recipient) ⇒ Message
constructor
A new instance of Message.
- #send_sms! ⇒ Object
Constructor Details
#initialize(contents, twilio_client, recipient) ⇒ Message
Returns a new instance of Message.
44 45 46 47 48 |
# File 'lib/ai_noto.rb', line 44 def initialize(contents, twilio_client, recipient) @contents = contents @twilio_client = twilio_client @recipient = recipient end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
42 43 44 |
# File 'lib/ai_noto.rb', line 42 def contents @contents end |
#recipient ⇒ Object
Returns the value of attribute recipient.
42 43 44 |
# File 'lib/ai_noto.rb', line 42 def recipient @recipient end |
#twilio_client ⇒ Object
Returns the value of attribute twilio_client.
42 43 44 |
# File 'lib/ai_noto.rb', line 42 def twilio_client @twilio_client end |
Instance Method Details
#send_sms! ⇒ Object
50 51 52 53 54 |
# File 'lib/ai_noto.rb', line 50 def send_sms! twilio_client.api.account..create(from: AiNoto.from_number, to: AiNoto.to_number(recipient), body: contents) end |