lib/tracker_api/resources/story.rb in tracker_api-1.10.0 vs lib/tracker_api/resources/story.rb in tracker_api-1.11.0

- old
+ new

@@ -6,10 +6,11 @@ attribute :client attribute :accepted_at, DateTime attribute :after_id, Integer attribute :before_id, Integer + attribute :blockers, [Blocker] attribute :comment_ids, [Integer] attribute :comments, [Comment] attribute :created_at, DateTime attribute :current_state, String # (accepted, delivered, finished, started, rejected, planned, unstarted, unscheduled) attribute :deadline, DateTime @@ -29,10 +30,11 @@ attribute :owners, [Person] attribute :planned_iteration_number, Integer attribute :project_id, Integer attribute :requested_by, Person attribute :requested_by_id, Integer + attribute :reviews, [Review] attribute :story_type, String # (feature, bug, chore, release) attribute :task_ids, [Integer] attribute :tasks, [Task] attribute :transitions, [StoryTransition] attribute :updated_at, DateTime @@ -116,10 +118,14 @@ # @return [Array[Activity]] def activity(params = {}) Endpoints::Activity.new(client).get_story(project_id, id, params) end + def blockers(params = {}) + Endpoints::Blockers.new(client).get(project_id, id, params) + end + # Provides a list of all the comments on the story. # # @param [Hash] params # @return [Array[Comment]] def comments(reload: false) @@ -196,9 +202,17 @@ def save raise ArgumentError, 'Can not update a story with an unknown project_id.' if project_id.nil? return self unless dirty? Endpoints::Story.new(client).update(self, UpdateRepresenter.new(Story.new(self.dirty_attributes))) + end + + def reviews(params = {}) + if params.blank? && @reviews.present? + @reviews + else + @reviews = Endpoints::Reviews.new(client).get(project_id, id, params) + end end end end end