Module: Pivit::Client::Note

Included in:
Pivit::Client
Defined in:
lib/pivit/client/note.rb

Overview

Note management

Instance Method Summary collapse

Instance Method Details

#create_note(project_id, story_id, text, options = {}) ⇒ Hashie::Mash

Create a note

Provide the parameters you want to use for the note via the options hash

Examples:

Pivit::Client.create_note(111111, 222222, "some not text")

Parameters:

  • project_id (Integer)

    the id of the project that contains the story

  • story_id (Integer)

    the id of the story that contains the note

  • text (String)

    the text that the story note will contain

Returns:

  • (Hashie::Mash)

    note created response

See Also:

Author:

  • Jason Truluck



41
42
43
44
# File 'lib/pivit/client/note.rb', line 41

def create_note(project_id, story_id, text, options = {})
  options = { :note => options.merge!(:text => text) }
  post("projects/#{project_id}/stories", options).note
end

#notes(project_id, story_id, options = {}) ⇒ Hashie::Mash

Retrieve all notes for a story

Examples:

Pivit::Client.notes(1111111, 222222)

Parameters:

  • project_id (Integer)

    the id of the project that contains the notes

  • story_id (Integer)

    the id of the story that contains the notes

Returns:

  • (Hashie::Mash)

    notes response

Author:

  • Jason Truluck



20
21
22
# File 'lib/pivit/client/note.rb', line 20

def notes(project_id, story_id, options = {})
  get("projects/#{project_id}/stories/#{story_id}/notes", options).notes
end