Class: Todoist::Sync::Reminders

Inherits:
Todoist::Service show all
Includes:
Util
Defined in:
lib/todoist/sync/reminders.rb

Instance Method Summary collapse

Methods inherited from Todoist::Service

#initialize

Constructor Details

This class inherits a constructor from Todoist::Service

Instance Method Details

#add(args) ⇒ Object

Add a reminder with a given hash of attributes and returns the reminder id.

Please note that item_id is required as is a date as specific in the documentation. This method can be tricky to all.



14
15
16
# File 'lib/todoist/sync/reminders.rb', line 14

def add(args)
  return @client.api_helper.add(args, "reminder_add")
end

#clear_locationsObject

Clear locations which is used for location reminders



30
31
32
33
# File 'lib/todoist/sync/reminders.rb', line 30

def clear_locations
  args = {}
  return @client.api_helper.command(args, "clear_locations")
end

#collectionObject

Return a Hash of reminders where key is the id of a reminder and value is a reminder



7
8
9
# File 'lib/todoist/sync/reminders.rb', line 7

def collection
  return @client.api_helper.collection("reminders")
end

#delete(reminder) ⇒ Object

Delete reminder given an array of reminders



24
25
26
27
# File 'lib/todoist/sync/reminders.rb', line 24

def delete(reminder)
  args = {id: reminder.id}
  return @client.api_helper.command(args, "reminder_delete")
end

#update(args) ⇒ Object

Update a reminder given a hash of attributes



19
20
21
# File 'lib/todoist/sync/reminders.rb', line 19

def update(args)
  return @client.api_helper.command(args, "reminder_update")
end