Class: VoiceML::PricingMessagingCountry

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 = {}) ⇒ PricingMessagingCountry

Returns a new instance of PricingMessagingCountry.



140
141
142
143
144
145
146
147
148
149
# File 'lib/voiceml/models/pricing.rb', line 140

def initialize(attrs = {})
  @country     = attrs['country'] || attrs[:country]
  @iso_country = attrs['iso_country'] || attrs[:iso_country]
  @outbound_sms_prices =
    (attrs['outbound_sms_prices'] || []).map { |h| PricingOutboundSMSPrice.from_hash(h) }
  @inbound_sms_prices =
    (attrs['inbound_sms_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.



139
140
141
# File 'lib/voiceml/models/pricing.rb', line 139

def country
  @country
end

#inbound_sms_pricesObject (readonly)

Returns the value of attribute inbound_sms_prices.



139
140
141
# File 'lib/voiceml/models/pricing.rb', line 139

def inbound_sms_prices
  @inbound_sms_prices
end

#iso_countryObject (readonly)

Returns the value of attribute iso_country.



139
140
141
# File 'lib/voiceml/models/pricing.rb', line 139

def iso_country
  @iso_country
end

#outbound_sms_pricesObject (readonly)

Returns the value of attribute outbound_sms_prices.



139
140
141
# File 'lib/voiceml/models/pricing.rb', line 139

def outbound_sms_prices
  @outbound_sms_prices
end

#price_unitObject (readonly)

Returns the value of attribute price_unit.



139
140
141
# File 'lib/voiceml/models/pricing.rb', line 139

def price_unit
  @price_unit
end

#urlObject (readonly)

Returns the value of attribute url.



139
140
141
# File 'lib/voiceml/models/pricing.rb', line 139

def url
  @url
end

Class Method Details

.from_hash(h) ⇒ Object



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

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