Class: Dirigible::Schedule
- Inherits:
-
Object
- Object
- Dirigible::Schedule
- Defined in:
- lib/dirigible/schedule.rb
Overview
Class Method Summary collapse
-
.create(params) ⇒ Object
Scheduled notifications are created by POSTing to the schedule URI.
-
.delete(id) ⇒ Object
Delete a schedule resource, which will result in no more pushes being sent.
-
.get(id) ⇒ Object
Fetch the current definition of a single schedule resource.
-
.list ⇒ Object
List all existing schedules.
-
.update(id, params) ⇒ Object
Update the state of a single schedule resource.
Class Method Details
.create(params) ⇒ Object
Scheduled notifications are created by POSTing to the schedule URI. The body of the request must be one of:
-
A single schedule object.
-
An array of one or more schedule objects.
21 22 23 |
# File 'lib/dirigible/schedule.rb', line 21 def self.create(params) Dirigible.post('/schedules', params) end |
.delete(id) ⇒ Object
Delete a schedule resource, which will result in no more pushes being sent. If the resource is succesfully deleted, the response does not include a body.
74 75 76 |
# File 'lib/dirigible/schedule.rb', line 74 def self.delete(id) Dirigible.delete("/schedules/#{id}") end |
.get(id) ⇒ Object
Fetch the current definition of a single schedule resource. Returns a single schedule object.
43 44 45 |
# File 'lib/dirigible/schedule.rb', line 43 def self.get(id) Dirigible.get("/schedules/#{id}") end |
.list ⇒ Object
List all existing schedules. Returns an array of schedule objects in the “schedules” attribute.
32 33 34 |
# File 'lib/dirigible/schedule.rb', line 32 def self.list Dirigible.get('/schedules') end |
.update(id, params) ⇒ Object
Update the state of a single schedule resource. The body must contain a single schedule object.
62 63 64 |
# File 'lib/dirigible/schedule.rb', line 62 def self.update(id, params) Dirigible.put("/schedules/#{id}", params) end |