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 name of the country.
-
#fetch ⇒ CountryInstance
Fetch the 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 code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
-
#phone_number_prices ⇒ Array<PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices>
The list of [PhoneNumberPrice](www.twilio.com/docs/phone-numbers/pricing#phone-number-price) records.
-
#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, iso_country: nil) ⇒ CountryInstance
Initialize the CountryInstance
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 385 def initialize(version, payload , iso_country: nil) super(version) # Marshaled Properties @properties = { 'country' => payload['country'], 'iso_country' => payload['iso_country'], 'phone_number_prices' => payload['phone_number_prices'], 'price_unit' => payload['price_unit'], 'url' => payload['url'], } # 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
407 408 409 410 411 412 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 407 def context unless @instance_context @instance_context = CountryContext.new(@version , @params['iso_country']) end @instance_context end |
#country ⇒ String
Returns The name of the country.
416 417 418 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 416 def country @properties['country'] end |
#fetch ⇒ CountryInstance
Fetch the CountryInstance
447 448 449 450 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 447 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
461 462 463 464 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 461 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.CountryInstance #{values}>" end |
#iso_country ⇒ String
Returns The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
422 423 424 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 422 def iso_country @properties['iso_country'] end |
#phone_number_prices ⇒ Array<PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices>
Returns The list of [PhoneNumberPrice](www.twilio.com/docs/phone-numbers/pricing#phone-number-price) records.
428 429 430 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 428 def phone_number_prices @properties['phone_number_prices'] 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`).
434 435 436 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 434 def price_unit @properties['price_unit'] end |
#to_s ⇒ Object
Provide a user friendly representation
454 455 456 457 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 454 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.CountryInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource.
440 441 442 |
# File 'lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb', line 440 def url @properties['url'] end |