lib/tracker_api/resources/story.rb in tracker_api-0.2.7 vs lib/tracker_api/resources/story.rb in tracker_api-0.2.8

- old
+ new

@@ -5,10 +5,11 @@ attribute :client attribute :accepted_at, DateTime attribute :comment_ids, Array[Integer] + attribute :comments, Array[TrackerApi::Resources::Comment] attribute :created_at, DateTime attribute :current_state, String # (accepted, delivered, finished, started, rejected, planned, unstarted, unscheduled) attribute :deadline, DateTime attribute :description, String attribute :estimate, Float @@ -40,9 +41,21 @@ # # @param [Hash] params # @return [Array[Activity]] def activity(params = {}) Endpoints::Activity.new(client).get_story(project_id, id, params) + end + + # Provides a list of all the comments on the story. + # + # @param [Hash] params + # @return [Array[Comment]] + def comments(params = {}) + if @comments.any? + @comments + else + @comments = Endpoints::Comments.new(client).get(project_id, id, params) + end end # @param [Hash] params # @return [Array[Task]] def tasks(params = {})