Class: ClickSend::REST::AccountBalance
- Defined in:
- lib/click_send/rest/account_balance.rb
Overview
A class to wrap account balance related functionality within the ClickSend API.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#all(opts = {}) ⇒ Object
Get account balance details from ClickSend API.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from ClickSend::REST::Resource
Instance Method Details
#all(opts = {}) ⇒ Object
Get account balance details from ClickSend API. The following keys are optional:
:country => 'AU'
A 2-letter country code (ISO 3166-1 Alpha-2 code).
e.g. “AU” = Australia.
If provided, the response will show the account balance and the number of SMS messages you can send to the country specified (credit).
If the country isn’t provided, the response will only show the account balance.
20 21 22 23 24 |
# File 'lib/click_send/rest/account_balance.rb', line 20 def all(opts={}) params = {method: 'rest'} params.merge!(country: opts[:country]) if opts[:country] perform_request(:post, '/rest/v2/balance.json', params) end |