Class: Nexmo::Pricing

Inherits:
Namespace show all
Defined in:
lib/nexmo/pricing.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, type: nil) ⇒ Pricing

Returns a new instance of Pricing.

Raises:

  • (ArgumentError)


5
6
7
8
9
# File 'lib/nexmo/pricing.rb', line 5

def initialize(client, type: nil)
  raise ArgumentError if type.nil?

  @client, @type = client, type
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/nexmo/pricing.rb', line 11

def type
  @type
end

Instance Method Details

#get(country) ⇒ Object



13
14
15
# File 'lib/nexmo/pricing.rb', line 13

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

#listObject



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

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

#prefix(prefix) ⇒ Object



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

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