Class: TrackerApi::Resources::Story

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/tracker_api/resources/story.rb

Instance Method Summary collapse

Instance Method Details

#activity(params = {}) ⇒ Array[Activity]

Provides a list of all the activity performed on the story.

Parameters:

  • params (Hash) (defaults to: {})

Returns:



43
44
45
# File 'lib/tracker_api/resources/story.rb', line 43

def activity(params = {})
  Endpoints::Activity.new(client).get_story(project_id, id, params)
end

#label_listString

Returns Comma separated list of labels.

Returns:

  • (String)

    Comma separated list of labels.



35
36
37
# File 'lib/tracker_api/resources/story.rb', line 35

def label_list
  @label_list ||= labels.collect(&:name).join(',')
end

#saveObject

Save changes to an existing Story.

Raises:

  • (ArgumentError)


58
59
60
61
62
63
64
# File 'lib/tracker_api/resources/story.rb', line 58

def save
  raise ArgumentError, 'Can not update a story with an unknown project_id.' if project_id.nil?

  Endpoints::Story.new(client).update(self, just_changes)

  changes_applied
end

#tasks(params = {}) ⇒ Array[Task]

Parameters:

  • params (Hash) (defaults to: {})

Returns:



49
50
51
52
53
54
55
# File 'lib/tracker_api/resources/story.rb', line 49

def tasks(params = {})
  if @tasks.any?
    @tasks
  else
    @tasks = Endpoints::Tasks.new(client).get(project_id, id, params)
  end
end