Class: Twilio::REST::Pricing::V2::CountryInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Pricing::V2::CountryInstance
- Defined in:
- lib/twilio-ruby/rest/pricing/v2/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).
-
#originating_call_prices ⇒ Array<PricingV2TrunkingCountryInstanceOriginatingCallPrices>
The list of [OriginatingCallPrice](www.twilio.com/docs/voice/pricing#inbound-call-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`).
-
#terminating_prefix_prices ⇒ Array<PricingV2TrunkingCountryInstanceTerminatingPrefixPrices>
The list of [TerminatingPrefixPrice](www.twilio.com/docs/voice/pricing#outbound-prefix-price-with-origin) records.
-
#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
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 218 def initialize(version, payload , iso_country: nil) super(version) # Marshaled Properties @properties = { 'country' => payload['country'], 'iso_country' => payload['iso_country'], 'terminating_prefix_prices' => payload['terminating_prefix_prices'], 'originating_call_prices' => payload['originating_call_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
240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 240 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.
249 250 251 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 249 def country @properties['country'] end |
#fetch ⇒ CountryInstance
Fetch the CountryInstance
286 287 288 289 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 286 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
300 301 302 303 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 300 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V2.CountryInstance #{values}>" end |
#iso_country ⇒ String
Returns The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
255 256 257 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 255 def iso_country @properties['iso_country'] end |
#originating_call_prices ⇒ Array<PricingV2TrunkingCountryInstanceOriginatingCallPrices>
Returns The list of [OriginatingCallPrice](www.twilio.com/docs/voice/pricing#inbound-call-price) records.
267 268 269 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 267 def originating_call_prices @properties['originating_call_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`).
273 274 275 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 273 def price_unit @properties['price_unit'] end |
#terminating_prefix_prices ⇒ Array<PricingV2TrunkingCountryInstanceTerminatingPrefixPrices>
Returns The list of [TerminatingPrefixPrice](www.twilio.com/docs/voice/pricing#outbound-prefix-price-with-origin) records.
261 262 263 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 261 def terminating_prefix_prices @properties['terminating_prefix_prices'] end |
#to_s ⇒ Object
Provide a user friendly representation
293 294 295 296 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 293 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V2.CountryInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource.
279 280 281 |
# File 'lib/twilio-ruby/rest/pricing/v2/country.rb', line 279 def url @properties['url'] end |