Class: Twilio::REST::Trunking::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/trunking/v1.rb,
lib/twilio-ruby/rest/trunking/v1/trunk.rb,
lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb,
lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb,
lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb,
lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb,
lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb

Defined Under Namespace

Classes: TrunkContext, TrunkInstance, TrunkList, TrunkPage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Trunking



21
22
23
24
25
# File 'lib/twilio-ruby/rest/trunking/v1.rb', line 21

def initialize(domain)
    super
    @version = 'v1'
    @trunks = nil
end

Instance Method Details

#to_sObject

Provide a user friendly representation



43
44
45
# File 'lib/twilio-ruby/rest/trunking/v1.rb', line 43

def to_s
    '<Twilio::REST::Trunking::V1>';
end

#trunks(sid = :unset) ⇒ Twilio::REST::Trunking::V1::TrunkContext, Twilio::REST::Trunking::V1::TrunkList

Parameters:

  • sid (String) (defaults to: :unset)

    The unique string that we created to identify the Trunk resource to fetch.

Returns:



31
32
33
34
35
36
37
38
39
40
# File 'lib/twilio-ruby/rest/trunking/v1.rb', line 31

def trunks(sid=:unset)
    if sid.nil?
        raise ArgumentError, 'sid cannot be nil'
    end
    if sid == :unset
        @trunks ||= TrunkList.new self
    else
        TrunkContext.new(self, sid)
    end
end