Class: TrackerApi::Resources::Story
- Includes:
- TrackerApi::Resources::Shared::HasId
- Defined in:
- lib/tracker_api/resources/story.rb
Defined Under Namespace
Classes: UpdateRepresenter
Instance Method Summary collapse
-
#activity(params = {}) ⇒ Array[Activity]
Provides a list of all the activity performed on the story.
-
#comments(params = {}) ⇒ Array[Comment]
Provides a list of all the comments on the story.
-
#create_task(params) ⇒ Task
Newly created Task.
-
#label_list ⇒ String
Comma separated list of labels.
-
#owners(params = {}) ⇒ Array[Person]
Provides a list of all the owners of the story.
-
#save ⇒ Object
Save changes to an existing Story.
-
#tasks(params = {}) ⇒ Array[Task]
Provides a list of all the tasks on the story.
Methods included from TrackerApi::Resources::Shared::HasId
Instance Method Details
#activity(params = {}) ⇒ Array[Activity]
Provides a list of all the activity performed on the story.
66 67 68 |
# File 'lib/tracker_api/resources/story.rb', line 66 def activity(params = {}) Endpoints::Activity.new(client).get_story(project_id, id, params) end |
#comments(params = {}) ⇒ Array[Comment]
Provides a list of all the comments on the story.
74 75 76 77 78 79 80 |
# File 'lib/tracker_api/resources/story.rb', line 74 def comments(params = {}) if params.blank? && @comments.any? @comments else @comments = Endpoints::Comments.new(client).get(project_id, id, params) end end |
#create_task(params) ⇒ Task
Returns newly created Task.
108 109 110 |
# File 'lib/tracker_api/resources/story.rb', line 108 def create_task(params) Endpoints::Task.new(client).create(project_id, id, params) end |
#label_list ⇒ String
Returns Comma separated list of labels.
58 59 60 |
# File 'lib/tracker_api/resources/story.rb', line 58 def label_list @label_list ||= labels.collect(&:name).join(',') end |
#owners(params = {}) ⇒ Array[Person]
Provides a list of all the owners of the story.
98 99 100 101 102 103 104 |
# File 'lib/tracker_api/resources/story.rb', line 98 def owners(params = {}) if params.blank? && @owners.any? @owners else @owners = Endpoints::StoryOwners.new(client).get(project_id, id, params) end end |
#save ⇒ Object
Save changes to an existing Story.
113 114 115 116 117 |
# File 'lib/tracker_api/resources/story.rb', line 113 def save raise ArgumentError, 'Can not update a story with an unknown project_id.' if project_id.nil? Endpoints::Story.new(client).update(self, UpdateRepresenter.new(self)) end |