class Twilio::REST::Lookups::V1

Public Class Methods

new(domain) click to toggle source

Initialize the V1 version of Lookups

Calls superclass method Twilio::REST::Version::new
   # File lib/twilio-ruby/rest/lookups/v1.rb
15 def initialize(domain)
16   super
17   @version = 'v1'
18   @phone_numbers = nil
19 end

Public Instance Methods

phone_numbers(phone_number=:unset) click to toggle source

@param [String] phone_number The phone number to lookup in

{E.164}[https://www.twilio.com/docs/glossary/what-e164] format, which consists
of a + followed by the country code and subscriber number.

@return [Twilio::REST::Lookups::V1::PhoneNumberContext] if phone_number was passed. @return [Twilio::REST::Lookups::V1::PhoneNumberList]

   # File lib/twilio-ruby/rest/lookups/v1.rb
27 def phone_numbers(phone_number=:unset)
28   if phone_number.nil?
29       raise ArgumentError, 'phone_number cannot be nil'
30   end
31   if phone_number == :unset
32       @phone_numbers ||= PhoneNumberList.new self
33   else
34       PhoneNumberContext.new(self, phone_number)
35   end
36 end
to_s() click to toggle source

Provide a user friendly representation

   # File lib/twilio-ruby/rest/lookups/v1.rb
40 def to_s
41   '<Twilio::REST::Lookups::V1>'
42 end