Class: YandexTracker::Resources::Attachment

Inherits:
Base
  • Object
show all
Defined in:
lib/yandex_tracker/resources/attachment.rb

Overview

Resources::Attachment

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#delete, #get, #initialize, #patch, #post, #put

Constructor Details

This class inherits a constructor from YandexTracker::Resources::Base

Instance Method Details

#create(file, **attributes) ⇒ Object

Create unattached file



10
11
12
# File 'lib/yandex_tracker/resources/attachment.rb', line 10

def create(file, **attributes)
  upload("attachments", file, attributes)
end

#create_for_comment(issue_id, comment_id, file, **attributes) ⇒ Object

Upload file directly to comment



20
21
22
# File 'lib/yandex_tracker/resources/attachment.rb', line 20

def create_for_comment(issue_id, comment_id, file, **attributes)
  upload("issues/#{issue_id}/comments/#{comment_id}/attachments", file, attributes)
end

#create_for_issue(issue_id, file, **attributes) ⇒ Object

Upload file directly to issue



15
16
17
# File 'lib/yandex_tracker/resources/attachment.rb', line 15

def create_for_issue(issue_id, file, **attributes)
  upload("issues/#{issue_id}/attachments", file, attributes)
end

#find(id) ⇒ Object



24
25
26
# File 'lib/yandex_tracker/resources/attachment.rb', line 24

def find(id)
  get("attachments/#{id}")
end

#list(issue_id, **params) ⇒ Object



28
29
30
# File 'lib/yandex_tracker/resources/attachment.rb', line 28

def list(issue_id, **params)
  get("issues/#{issue_id}/attachments", params)
end