Class: Vonage::Pricing

Inherits:
Namespace
  • Object
show all
Defined in:
lib/vonage/pricing.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, type: nil) ⇒ Pricing

Returns a new instance of Pricing.

Raises:

  • (ArgumentError)


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

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

#listObject



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