Class: Twilio::REST::Api

Inherits:
Domain
  • Object
show all
Defined in:
lib/signalwire/sdk/twilio_set_host.rb

Instance Method Summary collapse

Methods inherited from Domain

#absolute_url

Constructor Details

#initialize(twilio) ⇒ Api

Returns a new instance of Api.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/signalwire/sdk/twilio_set_host.rb', line 6

def initialize(twilio)
  super

  @host = ENV['SIGNALWIRE_HOST'] ||
          ENV['SIGNALWIRE_API_HOSTNAME'] ||
          Signalwire::Sdk.configuration.hostname ||
          raise(ArgumentError,
                'SignalWire Space URL is not configured. Enter your SignalWire Space domain via the '\
                'SIGNALWIRE_HOST or SIGNALWIRE_API_HOSTNAME environment variables, '\
                'or hostname in the configuration.')

  @base_url = "https://#{@host}"
  @port = 443

  # Versions
  @v2010 = nil
end

Instance Method Details

#hostnameObject



24
25
26
# File 'lib/signalwire/sdk/twilio_set_host.rb', line 24

def hostname
  @host
end