Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 24 lines (19 sloc) 0.983 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
%w<rubygems active_support active_support/inflector cgi jwt httparty builder>.each { |lib| require lib }
%w<resource finder persistable deletable associations association_proxy>.each { |lib| require File.join(File.dirname(__FILE__), 'twilio', "#{lib}.rb") }

module Twilio
  API_ENDPOINT = 'https://api.twilio.com/2010-04-01'
  APIError = Class.new StandardError
  ConfigurationError = Class.new StandardError
  InvalidStateError = Class.new StandardError

  class << self
    def const_missing(const_name)
      if [:ACCOUNT_SID, :AUTH_TOKEN].include? const_name
        raise Twilio::ConfigurationError.new "Cannot complete request. Please set #{const_name.to_s.downcase} with Twilio::Config.setup first!"
      else
        super
      end
    end
  end
end

Dir[File.join(File.dirname(__FILE__), 'twilio', '*.rb')].each { |lib| require lib }

require File.join(File.dirname(__FILE__), 'railtie.rb') if Object.const_defined?(:Rails) && Rails.version =~ /^3/
Something went wrong with that request. Please try again.