Class: Twilio::REST::Lookups::V2::PhoneNumberContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Lookups::V2::PhoneNumberContext
- Defined in:
- lib/twilio-ruby/rest/lookups/v2/phone_number.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#fetch(fields: :unset, country_code: :unset) ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance.
-
#initialize(version, phone_number) ⇒ PhoneNumberContext
constructor
Initialize the PhoneNumberContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, phone_number) ⇒ PhoneNumberContext
Initialize the PhoneNumberContext
74 75 76 77 78 79 80 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 74 def initialize(version, phone_number) super(version) # Path Solution @solution = {phone_number: phone_number, } @uri = "/PhoneNumbers/#{@solution[:phone_number]}" end |
Instance Method Details
#fetch(fields: :unset, country_code: :unset) ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance
91 92 93 94 95 96 97 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 91 def fetch(fields: :unset, country_code: :unset) params = Twilio::Values.of({'Fields' => fields, 'CountryCode' => country_code, }) payload = @version.fetch('GET', @uri, params: params) PhoneNumberInstance.new(@version, payload, phone_number: @solution[:phone_number], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
108 109 110 111 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 108 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Lookups.V2.PhoneNumberContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
101 102 103 104 |
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 101 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Lookups.V2.PhoneNumberContext #{context}>" end |