Class: Twilio::REST::Lookups::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/lookups/v1.rb,
lib/twilio-ruby/rest/lookups/v1/phone_number.rb

Defined Under Namespace

Classes: PhoneNumberContext, PhoneNumberInstance, PhoneNumberList, PhoneNumberPage

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 Lookups



13
14
15
16
17
# File 'lib/twilio-ruby/rest/lookups/v1.rb', line 13

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

Instance Method Details

#phone_numbers(phone_number = :unset) ⇒ Twilio::REST::Lookups::V1::PhoneNumberInstance, Twilio::REST::Lookups::V1::PhoneNumberList

Parameters:

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

    The phone_number

Returns:



23
24
25
26
27
28
29
30
31
# File 'lib/twilio-ruby/rest/lookups/v1.rb', line 23

def phone_numbers(phone_number=:unset)
  if phone_number.nil?
    raise ArgumentError, 'phone_number cannot be nil'
  elsif phone_number == :unset
    @phone_numbers ||= PhoneNumberList.new self
  else
    PhoneNumberContext.new(self, phone_number)
  end
end

#to_sObject

Provide a user friendly representation



35
36
37
# File 'lib/twilio-ruby/rest/lookups/v1.rb', line 35

def to_s
  '<Twilio::REST::Lookups::V1>'
end