class TeleSign::Api
Attributes
phone_id[RW]
NOTE
You can obtain both your Customer ID and Secret Key from the TeleSign Customer Portal <https://portal.telesign.com/account_profile_api_auth.php>
verify[RW]
NOTE
You can obtain both your Customer ID and Secret Key from the TeleSign Customer Portal <https://portal.telesign.com/account_profile_api_auth.php>
Public Class Methods
new(opts = {})
click to toggle source
# File lib/telesign/api.rb, line 26 def initialize opts = {} @customer_id = opts[:customer_id] @secret_key = opts[:secret_key] api_host = opts[:api_host] || 'rest.telesign.com' ssl = opts[:ssl].nil? ? true : opts[:ssl] proxy_host = opts[:proxy_host] || nil http_root = ssl ? 'https' : 'http' proxy = proxy_host ? "#{http_root}://#{proxy_host}" : nil url = "#{http_root}://#{api_host}" @conn = Faraday.new(url: url) do |faraday| faraday.request :url_encoded if defined? Rails faraday.response :logger, Rails.logger else faraday.response :logger # log requests to STDOUT end faraday.adapter Faraday.default_adapter # make requests with Net::HTTP end @verify = Verify.new(conn: @conn, customer_id: opts[:customer_id], secret_key: opts[:secret_key]) @phone_id = PhoneId.new(conn: @conn, customer_id: opts[:customer_id], secret_key: opts[:secret_key]) end