Class: Twilio::REST::Pricing::V2::VoiceList::CountryInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Pricing::V2::VoiceList::CountryInstance
- Defined in:
- lib/twilio-ruby/rest/pricing/v2/voice/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.
-
#inbound_call_prices ⇒ Array<PricingV2TrunkingCountryInstanceOriginatingCallPrices>
The list of [InboundCallPrice](www.twilio.com/docs/voice/pricing#inbound-call-price) records.
-
#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).
-
#outbound_prefix_prices ⇒ Array<PricingV2TrunkingCountryInstanceTerminatingPrefixPrices>
The list of [OutboundPrefixPriceWithOrigin](www.twilio.com/docs/voice/pricing#outbound-prefix-price-with-origin) 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
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 210 def initialize(version, payload , iso_country: nil) super(version) # Marshaled Properties @properties = { 'country' => payload['country'], 'iso_country' => payload['iso_country'], 'outbound_prefix_prices' => payload['outbound_prefix_prices'], 'inbound_call_prices' => payload['inbound_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
232 233 234 235 236 237 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 232 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.
241 242 243 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 241 def country @properties['country'] end |
#fetch ⇒ CountryInstance
Fetch the CountryInstance
278 279 280 281 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 278 def fetch context.fetch end |
#inbound_call_prices ⇒ Array<PricingV2TrunkingCountryInstanceOriginatingCallPrices>
Returns The list of [InboundCallPrice](www.twilio.com/docs/voice/pricing#inbound-call-price) records.
259 260 261 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 259 def inbound_call_prices @properties['inbound_call_prices'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
292 293 294 295 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 292 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).
247 248 249 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 247 def iso_country @properties['iso_country'] end |
#outbound_prefix_prices ⇒ Array<PricingV2TrunkingCountryInstanceTerminatingPrefixPrices>
Returns The list of [OutboundPrefixPriceWithOrigin](www.twilio.com/docs/voice/pricing#outbound-prefix-price-with-origin) records.
253 254 255 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 253 def outbound_prefix_prices @properties['outbound_prefix_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`).
265 266 267 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 265 def price_unit @properties['price_unit'] end |
#to_s ⇒ Object
Provide a user friendly representation
285 286 287 288 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 285 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.
271 272 273 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice/country.rb', line 271 def url @properties['url'] end |