Class: Twilio::REST::Pricing::V1::PhoneNumberList::CountryInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Pricing::V1::PhoneNumberList::CountryInstance
- Defined in:
- lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb
Instance Method Summary collapse
-
#context ⇒ CountryContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country ⇒ String
The country.
-
#fetch ⇒ CountryInstance
Fetch a CountryInstance.
-
#initialize(version, payload, iso_country: nil) ⇒ CountryInstance
constructor
Initialize the CountryInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#iso_country ⇒ String
The iso_country.
-
#phone_number_prices ⇒ String
The phone_number_prices.
-
#price_unit ⇒ String
The price_unit.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, iso_country: nil) ⇒ CountryInstance
Initialize the CountryInstance
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 203 def initialize(version, payload, iso_country: nil) super(version) # Marshaled Properties @properties = { 'country' => payload['country'], 'iso_country' => payload['iso_country'], 'url' => payload['url'], 'phone_number_prices' => payload['phone_number_prices'], 'price_unit' => payload['price_unit'], } # Context @instance_context = nil @params = { 'iso_country' => iso_country || @properties['iso_country'], } end |
Instance Method Details
#context ⇒ CountryContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
226 227 228 229 230 231 232 233 234 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 226 def context unless @instance_context @instance_context = CountryContext.new( @version, @params['iso_country'], ) end @instance_context end |
#country ⇒ String
Returns The country.
238 239 240 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 238 def country @properties['country'] end |
#fetch ⇒ CountryInstance
Fetch a CountryInstance
269 270 271 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 269 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
282 283 284 285 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 282 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.CountryInstance #{values}>" end |
#iso_country ⇒ String
Returns The iso_country.
244 245 246 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 244 def iso_country @properties['iso_country'] end |
#phone_number_prices ⇒ String
Returns The phone_number_prices.
250 251 252 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 250 def phone_number_prices @properties['phone_number_prices'] end |
#price_unit ⇒ String
Returns The price_unit.
256 257 258 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 256 def price_unit @properties['price_unit'] end |
#to_s ⇒ Object
Provide a user friendly representation
275 276 277 278 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 275 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.CountryInstance #{values}>" end |
#url ⇒ String
Returns The url.
262 263 264 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 262 def url @properties['url'] end |