Class: Nexmo::Pricing

Inherits:
Namespace
  • Object
show all
Defined in:
lib/nexmo/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)

7
8
9
10
11
12
13
# File 'lib/nexmo/pricing.rb', line 7

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


15
16
17
# File 'lib/nexmo/pricing.rb', line 15

def type
  @type
end

Instance Method Details

#get(country) ⇒ Object


17
18
19
# File 'lib/nexmo/pricing.rb', line 17

def get(country)
  request('/account/get-pricing/outbound/' + @type, params: {country: country})
end

#listObject


21
22
23
# File 'lib/nexmo/pricing.rb', line 21

def list
  request('/account/get-full-pricing/outbound/' + @type)
end

#prefix(prefix) ⇒ Object


25
26
27
# File 'lib/nexmo/pricing.rb', line 25

def prefix(prefix)
  request('/account/get-prefix-pricing/outbound/' + @type, params: {prefix: prefix})
end