class Incognito::Sms

Attributes

phone_number[R]
sid[R]
token[R]

Public Class Methods

new(sid:, token:, phone_number:) click to toggle source
# File lib/incognito/sms.rb, line 3
def initialize(sid:, token:, phone_number:)
  @sid = sid
  @token = token
  @phone_number = phone_number
end

Public Instance Methods

send_message(to:, message:) click to toggle source
# File lib/incognito/sms.rb, line 9
def send_message(to:, message:)
  client.messages.create(body: message, from: phone_number, to: to)
end

Private Instance Methods

client() click to toggle source
# File lib/incognito/sms.rb, line 17
def client
  @client ||= Twilio::REST::Client.new(sid, token)
end