Class: Vonage::Pricing
- Inherits:
-
Namespace
- Object
- Namespace
- Vonage::Pricing
- Defined in:
- lib/vonage/pricing.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #get(country) ⇒ Object
-
#initialize(config, type: nil) ⇒ Pricing
constructor
A new instance of Pricing.
- #list ⇒ Object
- #prefix(prefix) ⇒ Object
Constructor Details
#initialize(config, type: nil) ⇒ Pricing
Returns a new instance of Pricing.
8 9 10 11 12 13 14 |
# File 'lib/vonage/pricing.rb', line 8 def initialize(config, type: nil) raise ArgumentError if type.nil? @type = type super config end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
16 17 18 |
# File 'lib/vonage/pricing.rb', line 16 def type @type end |
Instance Method Details
#get(country) ⇒ Object
18 19 20 |
# File 'lib/vonage/pricing.rb', line 18 def get(country) request('/account/get-pricing/outbound/' + @type, params: {country: country}) end |
#list ⇒ Object
22 23 24 |
# File 'lib/vonage/pricing.rb', line 22 def list request('/account/get-full-pricing/outbound/' + @type) end |
#prefix(prefix) ⇒ Object
26 27 28 |
# File 'lib/vonage/pricing.rb', line 26 def prefix(prefix) request('/account/get-prefix-pricing/outbound/' + @type, params: {prefix: prefix}) end |