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
Name of the country.
-
#fetch ⇒ NumberInstance
Fetch a NumberInstance.
-
#inbound_call_price ⇒ String
See InboundCallPrice record (returned as null if the Phone Number provided is not a Twilio number owned by this account).
-
#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.
-
#number ⇒ String
The number.
-
#outbound_call_price ⇒ String
See OutboundCallPrice record.
-
#price_unit ⇒ String
The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy).
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, number: nil) ⇒ NumberInstance
Initialize the NumberInstance
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 106 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
129 130 131 132 133 134 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 129 def context unless @instance_context @instance_context = NumberContext.new(@version, @params['number'], ) end @instance_context end |
#country ⇒ String
Returns Name of the country.
144 145 146 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 144 def country @properties['country'] end |
#fetch ⇒ NumberInstance
Fetch a NumberInstance
181 182 183 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 181 def fetch context.fetch end |
#inbound_call_price ⇒ String
Returns See InboundCallPrice record (returned as null if the Phone Number provided is not a Twilio number owned by this account).
162 163 164 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 162 def inbound_call_price @properties['inbound_call_price'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
194 195 196 197 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 194 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.NumberInstance #{values}>" end |
#iso_country ⇒ String
Returns The ISO country code.
150 151 152 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 150 def iso_country @properties['iso_country'] end |
#number ⇒ String
Returns The number.
138 139 140 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 138 def number @properties['number'] end |
#outbound_call_price ⇒ String
Returns See OutboundCallPrice record.
156 157 158 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 156 def outbound_call_price @properties['outbound_call_price'] end |
#price_unit ⇒ String
Returns The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy).
168 169 170 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 168 def price_unit @properties['price_unit'] end |
#to_s ⇒ Object
Provide a user friendly representation
187 188 189 190 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 187 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.NumberInstance #{values}>" end |
#url ⇒ String
Returns The url.
174 175 176 |
# File 'lib/twilio-ruby/rest/pricing/v1/voice/number.rb', line 174 def url @properties['url'] end |