Class: SerwerSMS::Resources::Groups
- Inherits:
-
Object
- Object
- SerwerSMS::Resources::Groups
- Defined in:
- lib/serwersms/resources/groups.rb
Instance Method Summary collapse
-
#add(name) ⇒ Hash
Add new group.
-
#check(phone) ⇒ Hash
View groups containing phone number.
-
#delete(id) ⇒ Hash
Delete a group.
-
#edit(id, name) ⇒ Hash
Edit a group.
-
#index(search = nil, params = {}) ⇒ Hash
List of groups.
-
#initialize(client) ⇒ Groups
constructor
A new instance of Groups.
-
#view(id) ⇒ Hash
View single group.
Constructor Details
#initialize(client) ⇒ Groups
Returns a new instance of Groups.
4 5 6 |
# File 'lib/serwersms/resources/groups.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#add(name) ⇒ Hash
Add new group
14 15 16 |
# File 'lib/serwersms/resources/groups.rb', line 14 def add(name) @client.call('groups/add', 'name' => name) end |
#check(phone) ⇒ Hash
View groups containing phone number
78 79 80 |
# File 'lib/serwersms/resources/groups.rb', line 78 def check(phone) @client.call('groups/check', 'phone' => phone) end |
#delete(id) ⇒ Hash
Delete a group
66 67 68 |
# File 'lib/serwersms/resources/groups.rb', line 66 def delete(id) @client.call('groups/delete', 'id' => id) end |
#edit(id, name) ⇒ Hash
Edit a group
57 58 59 |
# File 'lib/serwersms/resources/groups.rb', line 57 def edit(id, name) @client.call('groups/edit', 'id' => id, 'name' => name) end |
#index(search = nil, params = {}) ⇒ Hash
List of groups
34 35 36 37 |
# File 'lib/serwersms/resources/groups.rb', line 34 def index(search = nil, params = {}) params['search'] = search @client.call('groups/index', params) end |
#view(id) ⇒ Hash
View single group
46 47 48 |
# File 'lib/serwersms/resources/groups.rb', line 46 def view(id) @client.call('groups/view', 'id' => id) end |