Class: VoiceML::PricingVoiceCountryV2
- Inherits:
-
Object
- Object
- VoiceML::PricingVoiceCountryV2
- Defined in:
- lib/voiceml/models/pricing.rb
Overview
--- Pricing v2 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 = {}) ⇒ PricingVoiceCountryV2
constructor
A new instance of PricingVoiceCountryV2.
Constructor Details
#initialize(attrs = {}) ⇒ PricingVoiceCountryV2
Returns a new instance of PricingVoiceCountryV2.
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/voiceml/models/pricing.rb', line 170 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| PricingOutboundPrefixPriceWithOrigin.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.
169 170 171 |
# File 'lib/voiceml/models/pricing.rb', line 169 def country @country end |
#inbound_call_prices ⇒ Object (readonly)
Returns the value of attribute inbound_call_prices.
169 170 171 |
# File 'lib/voiceml/models/pricing.rb', line 169 def inbound_call_prices @inbound_call_prices end |
#iso_country ⇒ Object (readonly)
Returns the value of attribute iso_country.
169 170 171 |
# File 'lib/voiceml/models/pricing.rb', line 169 def iso_country @iso_country end |
#outbound_prefix_prices ⇒ Object (readonly)
Returns the value of attribute outbound_prefix_prices.
169 170 171 |
# File 'lib/voiceml/models/pricing.rb', line 169 def outbound_prefix_prices @outbound_prefix_prices end |
#price_unit ⇒ Object (readonly)
Returns the value of attribute price_unit.
169 170 171 |
# File 'lib/voiceml/models/pricing.rb', line 169 def price_unit @price_unit end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
169 170 171 |
# File 'lib/voiceml/models/pricing.rb', line 169 def url @url end |
Class Method Details
.from_hash(h) ⇒ Object
180 |
# File 'lib/voiceml/models/pricing.rb', line 180 def self.from_hash(h); h.nil? ? nil : new(h); end |