Class: TrackerApi::Resources::Epic

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

Defined Under Namespace

Classes: UpdateRepresenter

Instance Method Summary collapse

Methods included from Shared::Base

included

Instance Method Details

#create_comment(params) ⇒ Comment

Returns newly created Comment.

Parameters:

  • params (Hash)

    attributes to create the comment with

Returns:

  • (Comment)

    newly created Comment



40
41
42
43
44
45
# File 'lib/tracker_api/resources/epic.rb', line 40

def create_comment(params)
  files = params.delete(:files)
  comment = Endpoints::Comment.new(client).create(project_id, id, params)
  comment.create_attachments(files: files) if files.present?
  comment
end

#saveObject

Save changes to an existing Epic.

Raises:

  • (ArgumentError)


32
33
34
35
36
# File 'lib/tracker_api/resources/epic.rb', line 32

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

  Endpoints::Epic.new(client).update(self, UpdateRepresenter.new(self))
end