Sha256: 682c4b88fdd49d11060cbf0a8eef1e3e836150e962e3fc788a1e73b478f7099a
Contents?: true
Size: 1.28 KB
Versions: 3
Compression:
Stored size: 1.28 KB
Contents
require "twilio_with_thinq/version" require "twilio-ruby" module TwilioWithThinq # The main twilio wrapper class that inegrates thinQ. class TwilioWrapper TWIML_RESOURCE_URL = "http://cris.viralearnings.com/twiml/get_response" attr_accessor :client, :customer_number, :twilio_account_sid, :twilio_account_token, :twilio_phone_number, :callback_type, :callback_details def initialize(customer_number, twilio_account_sid, twilio_account_token, twilio_phone_number) @customer_number = customer_number @twilio_account_sid = twilio_account_sid @twilio_account_token = twilio_account_token @twilio_phone_number = twilio_phone_number @client = Twilio::REST::Client.new twilio_account_sid, twilio_account_token end def isClientValid? !@client.nil? and !@client.account.nil? end def call if !self.isClientValid? return "Invalid Twilio Account details." end begin @call = @client.account.calls.create({:to => @customer_number, :from => @twilio_phone_number, :url => TWIML_RESOURCE_URL}) return @call.sid rescue Exception => e return e.message end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
twilio_with_thinq-0.1.2 | lib/twilio_with_thinq.rb |
twilio_with_thinq-0.1.1 | lib/twilio_with_thinq.rb |
twilio_with_thinq-0.1.0 | lib/twilio_with_thinq.rb |