Class: Twilio::REST::Lookups::V1::PhoneNumberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Lookups::V1::PhoneNumberInstance
- Defined in:
- lib/twilio-ruby/rest/lookups/v1/phone_number.rb
Instance Method Summary collapse
-
#add_ons ⇒ Hash
The add_ons.
-
#caller_name ⇒ String
The caller_name.
-
#carrier ⇒ String
The carrier.
-
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country_code ⇒ String
The country_code.
-
#fetch(country_code: :unset, type: :unset, add_ons: :unset, add_ons_data: :unset) ⇒ PhoneNumberInstance
Fetch a PhoneNumberInstance.
-
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
constructor
Initialize the PhoneNumberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#national_format ⇒ String
The national_format.
-
#phone_number ⇒ String
The phone_number.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
Initialize the PhoneNumberInstance
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 112 def initialize(version, payload, phone_number: nil) super(version) # Marshaled Properties @properties = { 'caller_name' => payload['caller_name'], 'country_code' => payload['country_code'], 'phone_number' => payload['phone_number'], 'national_format' => payload['national_format'], 'carrier' => payload['carrier'], 'add_ons' => payload['add_ons'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'phone_number' => phone_number || @properties['phone_number'], } end |
Instance Method Details
#add_ons ⇒ Hash
Returns The add_ons.
174 175 176 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 174 def add_ons @properties['add_ons'] end |
#caller_name ⇒ String
Returns The caller_name.
144 145 146 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 144 def caller_name @properties['caller_name'] end |
#carrier ⇒ String
Returns The carrier.
168 169 170 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 168 def carrier @properties['carrier'] end |
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
135 136 137 138 139 140 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 135 def context unless @instance_context @instance_context = PhoneNumberContext.new(@version, @params['phone_number'], ) end @instance_context end |
#country_code ⇒ String
Returns The country_code.
150 151 152 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 150 def country_code @properties['country_code'] end |
#fetch(country_code: :unset, type: :unset, add_ons: :unset, add_ons_data: :unset) ⇒ PhoneNumberInstance
Fetch a PhoneNumberInstance
191 192 193 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 191 def fetch(country_code: :unset, type: :unset, add_ons: :unset, add_ons_data: :unset) context.fetch(country_code: country_code, type: type, add_ons: add_ons, add_ons_data: add_ons_data, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
204 205 206 207 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 204 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Lookups.V1.PhoneNumberInstance #{values}>" end |
#national_format ⇒ String
Returns The national_format.
162 163 164 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 162 def national_format @properties['national_format'] end |
#phone_number ⇒ String
Returns The phone_number.
156 157 158 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 156 def phone_number @properties['phone_number'] end |
#to_s ⇒ Object
Provide a user friendly representation
197 198 199 200 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 197 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Lookups.V1.PhoneNumberInstance #{values}>" end |
#url ⇒ String
Returns The url.
180 181 182 |
# File 'lib/twilio-ruby/rest/lookups/v1/phone_number.rb', line 180 def url @properties['url'] end |