Sha256: 7c817211617c5fc0b18d872d8a1ced87566c358c5d3fc67a1a263962d61399dd

Contents?: true

Size: 716 Bytes

Versions: 142

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

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)
        url = uri.match(/^http/) ? uri : absolute_url(uri)

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

Version data entries

142 entries across 142 versions & 2 rubygems

Version Path
twilio-ruby-7.3.6 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.3.5 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.3.4 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.3.3 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.3.2 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.3.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.3.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.2.4 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.2.3 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.2.2 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.2.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.2.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.1.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.0.2 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.0.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.0.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.0.0.pre.rc.3 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-7.0.0.pre.rc.2 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-6.12.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-6.12.0 lib/twilio-ruby/framework/rest/domain.rb