Class: VoiceML::PricingVoiceCountry
- Inherits:
-
Object
- Object
- VoiceML::PricingVoiceCountry
- Defined in:
- lib/voiceml/models/pricing.rb
Overview
--- Pricing v1 country / number bodies -----------------------------------
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#inbound_call_prices ⇒ Object
readonly
Returns the value of attribute inbound_call_prices.
-
#iso_country ⇒ Object
readonly
Returns the value of attribute iso_country.
-
#outbound_prefix_prices ⇒ Object
readonly
Returns the value of attribute outbound_prefix_prices.
-
#price_unit ⇒ Object
readonly
Returns the value of attribute price_unit.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ PricingVoiceCountry
constructor
A new instance of PricingVoiceCountry.
Constructor Details
#initialize(attrs = {}) ⇒ PricingVoiceCountry
Returns a new instance of PricingVoiceCountry.
111 112 113 114 115 116 117 118 119 120 |
# File 'lib/voiceml/models/pricing.rb', line 111 def initialize(attrs = {}) @country = attrs['country'] || attrs[:country] @iso_country = attrs['iso_country'] || attrs[:iso_country] @outbound_prefix_prices = (attrs['outbound_prefix_prices'] || []).map { |h| PricingOutboundPrefixPrice.from_hash(h) } @inbound_call_prices = (attrs['inbound_call_prices'] || []).map { |h| PricingInboundCallPrice.from_hash(h) } @price_unit = attrs['price_unit'] || attrs[:price_unit] @url = attrs['url'] || attrs[:url] end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
110 111 112 |
# File 'lib/voiceml/models/pricing.rb', line 110 def country @country end |
#inbound_call_prices ⇒ Object (readonly)
Returns the value of attribute inbound_call_prices.
110 111 112 |
# File 'lib/voiceml/models/pricing.rb', line 110 def inbound_call_prices @inbound_call_prices end |
#iso_country ⇒ Object (readonly)
Returns the value of attribute iso_country.
110 111 112 |
# File 'lib/voiceml/models/pricing.rb', line 110 def iso_country @iso_country end |
#outbound_prefix_prices ⇒ Object (readonly)
Returns the value of attribute outbound_prefix_prices.
110 111 112 |
# File 'lib/voiceml/models/pricing.rb', line 110 def outbound_prefix_prices @outbound_prefix_prices end |
#price_unit ⇒ Object (readonly)
Returns the value of attribute price_unit.
110 111 112 |
# File 'lib/voiceml/models/pricing.rb', line 110 def price_unit @price_unit end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
110 111 112 |
# File 'lib/voiceml/models/pricing.rb', line 110 def url @url end |
Class Method Details
.from_hash(h) ⇒ Object
121 |
# File 'lib/voiceml/models/pricing.rb', line 121 def self.from_hash(h); h.nil? ? nil : new(h); end |