lib/tracker_api/endpoints/story.rb in tracker_api-0.2.6 vs lib/tracker_api/endpoints/story.rb in tracker_api-0.2.7
- old
+ new
@@ -22,8 +22,16 @@
def create(project_id, params={})
data = client.post("/projects/#{project_id}/stories", params: params).body
Resources::Story.new({ client: client }.merge(data))
end
+
+ def update(story, params={})
+ raise ArgumentError, 'Valid story required to update.' unless story.instance_of?(Resources::Story)
+
+ data = client.put("/projects/#{story.project_id}/stories/#{story.id}", params: params).body
+
+ story.attributes = data
+ end
end
end
end