class TrackerApi::Endpoints::Attachments

Attributes

client[RW]

Public Class Methods

new(client) click to toggle source
# File lib/tracker_api/endpoints/attachments.rb, line 6
def initialize(client)
  @client = client
end

Public Instance Methods

create(comment, files) click to toggle source
# File lib/tracker_api/endpoints/attachments.rb, line 11
def create(comment, files)
  return [] if files.to_a.empty?
  #Check files before upload to make it all or none.
  FileUtility.check_files_exist(files)
  attachment = Endpoints::Attachment.new(client)
  files.map do | file |
    attachment.create(comment, file)
  end  
end