Sha256: 50c7921a75f2cffc4163ab1bfe06bae2c5742aa9b3c75eb24fbd67a839358401

Contents?: true

Size: 932 Bytes

Versions: 7

Compression:

Stored size: 932 Bytes

Contents

module Todoist
  module Sync
    class Notes < Todoist::Service
        include Todoist::Util  

        # Return a Hash of notes where key is the id of a note and value is a note
        def collection
          return @client.api_helper.collection("notes")
        end

        # 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.
        def add(args)
          return @client.api_helper.add(args, "note_add")
        end

        # Update a note given a hash of attributes
        def update(args)
          return @client.api_helper.command(args, "note_update")
        end

        # Delete notes given an a note
        def delete(note)
          args = {id: note.id}
          return @client.api_helper.command(args, "note_delete")
        end

      
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
todoist-ruby-0.2.7 lib/todoist/sync/notes.rb
todoist-ruby-0.2.6 lib/todoist/sync/notes.rb
todoist-ruby-0.2.5 lib/todoist/sync/notes.rb
todoist-ruby-0.2.4 lib/todoist/sync/notes.rb
todoist-ruby-0.2.3 lib/todoist/sync/notes.rb
todoist-ruby-0.2.2 lib/todoist/sync/notes.rb
todoist-ruby-0.2.1 lib/todoist/sync/notes.rb