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-5.73.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.72.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.72.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.71.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.70.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.70.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.69.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.68.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.67.3 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.67.2 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.67.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.67.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.66.2 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.66.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.66.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.65.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.65.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.64.0 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.63.1 lib/twilio-ruby/framework/rest/domain.rb
twilio-ruby-5.63.0 lib/twilio-ruby/framework/rest/domain.rb