Class: SerwerSMS::Resources::Templates
- Inherits:
-
Object
- Object
- SerwerSMS::Resources::Templates
- Defined in:
- lib/serwersms/resources/templates.rb
Instance Method Summary collapse
-
#add(name, text) ⇒ Hash
Add new template.
-
#delete(id) ⇒ Hash
Delete a template.
-
#edit(id, name, text) ⇒ Hash
Edit a template.
-
#index(params = {}) ⇒ Hash
List of templates.
-
#initialize(client) ⇒ Templates
constructor
A new instance of Templates.
Constructor Details
#initialize(client) ⇒ Templates
Returns a new instance of Templates.
4 5 6 |
# File 'lib/serwersms/resources/templates.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#add(name, text) ⇒ Hash
Add new template
29 30 31 |
# File 'lib/serwersms/resources/templates.rb', line 29 def add(name, text) @client.call('templates/add', 'name' => name, 'text' => text) end |
#delete(id) ⇒ Hash
Delete a template
50 51 52 |
# File 'lib/serwersms/resources/templates.rb', line 50 def delete(id) @client.call('templates/delete', 'id' => id) end |
#edit(id, name, text) ⇒ Hash
Edit a template
41 42 43 |
# File 'lib/serwersms/resources/templates.rb', line 41 def edit(id, name, text) @client.call('templates/edit', 'id' => id, 'name' => name, 'text' => text) end |
#index(params = {}) ⇒ Hash
List of templates
18 19 20 |
# File 'lib/serwersms/resources/templates.rb', line 18 def index(params = {}) @client.call('templates/index', params) end |