Class: Twilio::REST::Pricing::V1::VoiceList::NumberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Pricing::V1::VoiceList::NumberInstance
- Defined in:
- lib/twilio-ruby/rest/pricing/v1/voice/number.rb
Instance Method Summary collapse
-
#context ⇒ NumberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country ⇒ String
The name of the country.
-
#fetch ⇒ NumberInstance
Fetch the NumberInstance.
- #inbound_call_price ⇒ PricingV1VoiceVoiceNumberInboundCallPrice
-
#initialize(version, payload, number: nil) ⇒ NumberInstance
constructor
Initialize the NumberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#iso_country ⇒ String
The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
-
#number ⇒ String
The phone number.
- #outbound_call_price ⇒ PricingV1VoiceVoiceNumberOutboundCallPrice
-
#price_unit ⇒ String
The currency in which prices are measured, specified in [ISO 4127](www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. ‘usd`, `eur`, `jpy`).
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, number: nil) ⇒ NumberInstance
Initialize the NumberInstance
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 126 def initialize(version, payload , number: nil) super(version) # Marshaled Properties @properties = { 'number' => payload['number'], 'country' => payload['country'], 'iso_country' => payload['iso_country'], 'outbound_call_price' => payload['outbound_call_price'], 'inbound_call_price' => payload['inbound_call_price'], 'price_unit' => payload['price_unit'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'number' => number || @properties['number'] , } end |
Instance Method Details
#context ⇒ NumberContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
149 150 151 152 153 154 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 149 def context unless @instance_context @instance_context = NumberContext.new(@version , @params['number']) end @instance_context end |
#country ⇒ String
Returns The name of the country.
164 165 166 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 164 def country @properties['country'] end |
#fetch ⇒ NumberInstance
Fetch the NumberInstance
201 202 203 204 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 201 def fetch context.fetch end |
#inbound_call_price ⇒ PricingV1VoiceVoiceNumberInboundCallPrice
182 183 184 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 182 def inbound_call_price @properties['inbound_call_price'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
215 216 217 218 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 215 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.NumberInstance #{values}>" end |
#iso_country ⇒ String
Returns The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
170 171 172 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 170 def iso_country @properties['iso_country'] end |
#number ⇒ String
Returns The phone number.
158 159 160 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 158 def number @properties['number'] end |
#outbound_call_price ⇒ PricingV1VoiceVoiceNumberOutboundCallPrice
176 177 178 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 176 def outbound_call_price @properties['outbound_call_price'] end |
#price_unit ⇒ String
Returns The currency in which prices are measured, specified in [ISO 4127](www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. ‘usd`, `eur`, `jpy`).
188 189 190 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 188 def price_unit @properties['price_unit'] end |
#to_s ⇒ Object
Provide a user friendly representation
208 209 210 211 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 208 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.NumberInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource.
194 195 196 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 194 def url @properties['url'] end |