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



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

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

Instance Method Details

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

Parameters:

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

    The phone number to lookup in [E.164](www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number.

Returns:



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

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

#to_sObject

Provide a user friendly representation



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

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