lib/tracker_api/endpoints/epic.rb in tracker_api-0.2.12 vs lib/tracker_api/endpoints/epic.rb in tracker_api-1.0.0
- old
+ new
@@ -11,10 +11,16 @@
data = client.get("/projects/#{project_id}/epics/#{id}", params: params).body
Resources::Epic.new({ client: client, project_id: project_id }.merge(data))
end
+ def get_epic(epic_id, params={})
+ data = client.get("/epics/#{epic_id}", params: params).body
+
+ Resources::Epic.new({ client: client }.merge(data))
+ end
+
def create(project_id, params={})
data = client.post("/projects/#{project_id}/epics", params: params).body
Resources::Epic.new({ client: client }.merge(data))
end
@@ -23,9 +29,11 @@
raise ArgumentError, 'Valid epic required to update.' unless epic.instance_of?(Resources::Epic)
data = client.put("/projects/#{epic.project_id}/epics/#{epic.id}", params: params).body
epic.attributes = data
+ epic.clean!
+ epic
end
end
end
end