class Twilio::REST::Pricing::V1::VoiceList::NumberInstance

Public Class Methods

new(version, payload, number: nil) click to toggle source

Initialize the NumberInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] number The phone number to fetch. @return [NumberInstance] NumberInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
107 def initialize(version, payload, number: nil)
108   super(version)
109 
110   # Marshaled Properties
111   @properties = {
112       'number' => payload['number'],
113       'country' => payload['country'],
114       'iso_country' => payload['iso_country'],
115       'outbound_call_price' => payload['outbound_call_price'],
116       'inbound_call_price' => payload['inbound_call_price'],
117       'price_unit' => payload['price_unit'],
118       'url' => payload['url'],
119   }
120 
121   # Context
122   @instance_context = nil
123   @params = {'number' => number || @properties['number'], }
124 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [NumberContext] NumberContext for this NumberInstance

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
130 def context
131   unless @instance_context
132     @instance_context = NumberContext.new(@version, @params['number'], )
133   end
134   @instance_context
135 end
country() click to toggle source

@return [String] The name of the country

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
145 def country
146   @properties['country']
147 end
fetch() click to toggle source

Fetch the NumberInstance @return [NumberInstance] Fetched NumberInstance

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
182 def fetch
183   context.fetch
184 end
inbound_call_price() click to toggle source

@return [String] The InboundCallPrice record

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
163 def inbound_call_price
164   @properties['inbound_call_price']
165 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
195 def inspect
196   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
197   "<Twilio.Pricing.V1.NumberInstance #{values}>"
198 end
iso_country() click to toggle source

@return [String] The ISO country code

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
151 def iso_country
152   @properties['iso_country']
153 end
number() click to toggle source

@return [String] The phone number

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
139 def number
140   @properties['number']
141 end
outbound_call_price() click to toggle source

@return [String] The OutboundCallPrice record

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
157 def outbound_call_price
158   @properties['outbound_call_price']
159 end
price_unit() click to toggle source

@return [String] The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy)

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
169 def price_unit
170   @properties['price_unit']
171 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
188 def to_s
189   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
190   "<Twilio.Pricing.V1.NumberInstance #{values}>"
191 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/pricing/v1/voice/number.rb
175 def url
176   @properties['url']
177 end