Class: VoiceML::PricingPhoneNumberCountry

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ PricingPhoneNumberCountry

Returns a new instance of PricingPhoneNumberCountry.



155
156
157
158
159
160
161
162
# File 'lib/voiceml/models/pricing.rb', line 155

def initialize(attrs = {})
  @country     = attrs['country'] || attrs[:country]
  @iso_country = attrs['iso_country'] || attrs[:iso_country]
  @phone_number_prices =
    (attrs['phone_number_prices'] || []).map { |h| PricingPhoneNumberPrice.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.



154
155
156
# File 'lib/voiceml/models/pricing.rb', line 154

def country
  @country
end

#iso_countryObject (readonly)

Returns the value of attribute iso_country.



154
155
156
# File 'lib/voiceml/models/pricing.rb', line 154

def iso_country
  @iso_country
end

#phone_number_pricesObject (readonly)

Returns the value of attribute phone_number_prices.



154
155
156
# File 'lib/voiceml/models/pricing.rb', line 154

def phone_number_prices
  @phone_number_prices
end

#price_unitObject (readonly)

Returns the value of attribute price_unit.



154
155
156
# File 'lib/voiceml/models/pricing.rb', line 154

def price_unit
  @price_unit
end

#urlObject (readonly)

Returns the value of attribute url.



154
155
156
# File 'lib/voiceml/models/pricing.rb', line 154

def url
  @url
end

Class Method Details

.from_hash(h) ⇒ Object



163
# File 'lib/voiceml/models/pricing.rb', line 163

def self.from_hash(h); h.nil? ? nil : new(h); end