Class: Nexmo::Pricing
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #get(country) ⇒ Object
-
#initialize(client, type: nil) ⇒ Pricing
constructor
A new instance of Pricing.
- #list ⇒ Object
- #prefix(prefix) ⇒ Object
Constructor Details
#initialize(client, type: nil) ⇒ Pricing
Returns a new instance of Pricing.
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
#type ⇒ Object (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 |
#list ⇒ Object
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 |