Class: VoiceML::PricingVoiceCountry

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

Overview

--- Pricing v1 country / number bodies -----------------------------------

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#countryObject (readonly)

Returns the value of attribute country.



110
111
112
# File 'lib/voiceml/models/pricing.rb', line 110

def country
  @country
end

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

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