Sha256: c3839f3a905f3b52a75f8b4150f5740fcb52c5621eb06870c01401aee02427d7

Contents?: true

Size: 726 Bytes

Versions: 5

Compression:

Stored size: 726 Bytes

Contents

module Twilio
  module REST
    class Domain
      attr_reader :client

      def initialize(client)
        @client = client
        @host = nil
        @base_url = nil
        @port = nil
      end

      def absolute_url(uri)
        "#{@base_url.chomp('/')}/#{uri.chomp('/').gsub(/^\//, '')}"
      end

      def request(method, uri, params={}, data={}, headers={}, auth=nil, timeout=nil)
        if uri.match(/^http/)
          url = uri
        else
          url = self.absolute_url(uri)
        end

        @client.request(
          @host,
          @port,
          method,
          url,
          params,
          data,
          headers,
          auth,
          timeout
        )
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
twilio-ruby-5.0.0.rc26 lib/twilio-ruby/framework/domain.rb
twilio-ruby-5.0.0.rc25 lib/twilio-ruby/framework/domain.rb
twilio-ruby-5.0.0.rc24 lib/twilio-ruby/framework/domain.rb
twilio-ruby-5.0.0.rc23 lib/twilio-ruby/framework/domain.rb
twilio-ruby-5.0.0.rc22 lib/twilio-ruby/framework/domain.rb