Class: Todoist::Sync::Notes
- Inherits:
-
Todoist::Service
- Object
- Todoist::Service
- Todoist::Sync::Notes
- Includes:
- Util
- Defined in:
- lib/todoist/sync/notes.rb
Instance Method Summary collapse
-
#add(args) ⇒ Object
Add a note with a given hash of attributes and returns the note id.
-
#collection ⇒ Object
Return a Hash of notes where key is the id of a note and value is a note.
-
#delete(note) ⇒ Object
Delete notes given an a note.
-
#update(args) ⇒ Object
Update a note given a hash of attributes.
Methods inherited from Todoist::Service
Constructor Details
This class inherits a constructor from Todoist::Service
Instance Method Details
#add(args) ⇒ Object
Add a note with a given hash of attributes and returns the note id.
Please note that item_id or project_id key is required. In addition, content is also a required key in the hash.
14 15 16 |
# File 'lib/todoist/sync/notes.rb', line 14 def add(args) return @client.api_helper.add(args, "note_add") end |
#collection ⇒ Object
Return a Hash of notes where key is the id of a note and value is a note
7 8 9 |
# File 'lib/todoist/sync/notes.rb', line 7 def collection return @client.api_helper.collection("notes") end |
#delete(note) ⇒ Object
Delete notes given an a note
24 25 26 27 |
# File 'lib/todoist/sync/notes.rb', line 24 def delete(note) args = {id: note.id} return @client.api_helper.command(args, "note_delete") end |
#update(args) ⇒ Object
Update a note given a hash of attributes
19 20 21 |
# File 'lib/todoist/sync/notes.rb', line 19 def update(args) return @client.api_helper.command(args, "note_update") end |