Class: VoiceML::PricingVoiceCountryV2

Inherits:
Object
  • Object
show all
Defined in:
lib/voiceml/models/pricing.rb

Overview

--- Pricing v2 country / number bodies -----------------------------------

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#countryObject (readonly)

Returns the value of attribute country.



169
170
171
# File 'lib/voiceml/models/pricing.rb', line 169

def country
  @country
end

#inbound_call_pricesObject (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_countryObject (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_pricesObject (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_unitObject (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

#urlObject (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