Module: Pivit::Client::Story
- Included in:
- Pivit::Client
- Defined in:
- lib/pivit/client/story.rb
Overview
Story management
Instance Method Summary collapse
-
#add_attachment(project_id, story_id, file, options = {}) ⇒ Hashie::Mash
Add an attachement to a story.
-
#create_story(project_id, options = {}) ⇒ Hashie::Mash
Create a story.
-
#delete_story(project_id, story_id, options = {}) ⇒ Hashie::Mash
Delete a story.
-
#move_story_after(project_id, story_id, story_target_id, options = {}) ⇒ Hashie::Mash
Move a story after another story.
-
#move_story_before(project_id, story_id, story_target_id, options = {}) ⇒ Hashie::Mash
Move a story before another story.
-
#stories(project_id, options = {}) ⇒ Hashie::Mash
Retrieve all stories from your account.
-
#story(project_id, story_id, options = {}) ⇒ Hashie::Mash
Retrieve a single story from your account.
-
#update_story(project_id, story_id, options = {}) ⇒ Hashie::Mash
Update a story.
Instance Method Details
#add_attachment(project_id, story_id, file, options = {}) ⇒ Hashie::Mash
Add an attachement to a story
157 158 159 160 |
# File 'lib/pivit/client/story.rb', line 157 def (project_id, story_id, file, = {}) .merge!(:payload => file) post("projects/#{project_id}/stories/#{story_id}/attachments", ). end |
#create_story(project_id, options = {}) ⇒ Hashie::Mash
Create a story
Provide the parameters you want to use for the story via the options hash
64 65 66 67 |
# File 'lib/pivit/client/story.rb', line 64 def create_story(project_id, = {}) = { :story => } post("projects/#{project_id}/stories", ).story end |
#delete_story(project_id, story_id, options = {}) ⇒ Hashie::Mash
Delete a story
103 104 105 |
# File 'lib/pivit/client/story.rb', line 103 def delete_story(project_id, story_id, = {}) delete("projects/#{project_id}/stories/#{story_id}", ).story end |
#move_story_after(project_id, story_id, story_target_id, options = {}) ⇒ Hashie::Mash
Move a story after another story
139 140 141 |
# File 'lib/pivit/client/story.rb', line 139 def move_story_after(project_id, story_id, story_target_id, = {}) move_story(project_id, story_id, story_target_id, :after, ) end |
#move_story_before(project_id, story_id, story_target_id, options = {}) ⇒ Hashie::Mash
Move a story before another story
121 122 123 |
# File 'lib/pivit/client/story.rb', line 121 def move_story_before(project_id, story_id, story_target_id, = {}) move_story(project_id, story_id, story_target_id, :before, ) end |
#stories(project_id, options = {}) ⇒ Hashie::Mash
Retrieve all stories from your account
You can also use any filter option provided by pivotal tracker by prefacing with the option :filter
46 47 48 |
# File 'lib/pivit/client/story.rb', line 46 def stories(project_id, = {}) get("projects/#{project_id}/stories/", ).stories end |
#story(project_id, story_id, options = {}) ⇒ Hashie::Mash
Retrieve a single story from your account
22 23 24 |
# File 'lib/pivit/client/story.rb', line 22 def story(project_id, story_id, = {}) get("projects/#{project_id}/stories/#{story_id}", ).story end |
#update_story(project_id, story_id, options = {}) ⇒ Hashie::Mash
Update a story
Provide the parameters you want to use for the story via the options hash
85 86 87 88 |
# File 'lib/pivit/client/story.rb', line 85 def update_story(project_id, story_id, = {}) = { :story => } put("projects/#{project_id}/stories/#{story_id}", ).story end |