Class: SerwerSMS::Resources::Subaccounts
- Inherits:
-
Object
- Object
- SerwerSMS::Resources::Subaccounts
- Defined in:
- lib/serwersms/resources/subaccounts.rb
Instance Method Summary collapse
-
#add(subaccount_username, subaccount_password, subaccount_id, params = {}) ⇒ Hash
Create new subaccount.
-
#delete(id) ⇒ Hash
Delete a subaccount.
-
#index(params = {}) ⇒ Hash
List of subaccounts.
-
#initialize(client) ⇒ Subaccounts
constructor
A new instance of Subaccounts.
-
#limit(id, type, value) ⇒ Hash
Set limit on subaccount.
-
#view(id) ⇒ Hash
View subaccount details.
Constructor Details
#initialize(client) ⇒ Subaccounts
Returns a new instance of Subaccounts.
4 5 6 |
# File 'lib/serwersms/resources/subaccounts.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#add(subaccount_username, subaccount_password, subaccount_id, params = {}) ⇒ Hash
Create new subaccount
20 21 22 23 24 25 |
# File 'lib/serwersms/resources/subaccounts.rb', line 20 def add(subaccount_username, subaccount_password, subaccount_id, params = {}) params['subaccount_username'] = subaccount_username params['subaccount_password'] = subaccount_password params['subaccount_id'] = subaccount_id @client.call('subaccounts/add', params) end |
#delete(id) ⇒ Hash
Delete a subaccount
67 68 69 |
# File 'lib/serwersms/resources/subaccounts.rb', line 67 def delete(id) @client.call('subaccounts/delete', 'id' => id) end |
#index(params = {}) ⇒ Hash
List of subaccounts
33 34 35 |
# File 'lib/serwersms/resources/subaccounts.rb', line 33 def index(params = {}) @client.call('subaccounts/index', params) end |
#limit(id, type, value) ⇒ Hash
Set limit on subaccount
58 59 60 |
# File 'lib/serwersms/resources/subaccounts.rb', line 58 def limit(id, type, value) @client.call('subaccounts/limit', 'id' => id, 'type' => type, 'value' => value) end |
#view(id) ⇒ Hash
View subaccount details
46 47 48 |
# File 'lib/serwersms/resources/subaccounts.rb', line 46 def view(id) @client.call('subaccounts/view', 'id' => id) end |