Module: Teamlab::ProjectsFiles

Included in:
Project
Defined in:
lib/teamlab/modules/projects/projects_files.rb

Overview

Module for projects files methods

Instance Method Summary collapse

Instance Method Details

#detach_file_from_message(message_id, file_id) ⇒ Object



30
31
32
# File 'lib/teamlab/modules/projects/projects_files.rb', line 30

def detach_file_from_message(message_id, file_id)
  @request.delete(['message', message_id.to_s, 'files'], fileid: file_id)
end

#detach_file_from_task(task_id, file_id) ⇒ Object



26
27
28
# File 'lib/teamlab/modules/projects/projects_files.rb', line 26

def detach_file_from_task(task_id, file_id)
  @request.delete(['task', task_id.to_s, 'files'], fileid: file_id)
end

#get_entity_files(entity_id, entity_type) ⇒ Object



10
11
12
# File 'lib/teamlab/modules/projects/projects_files.rb', line 10

def get_entity_files(entity_id, entity_type)
  @request.get([entity_id.to_s, 'entityfiles'], entityType: entity_type)
end

#get_message_files(message_id) ⇒ Object



14
15
16
# File 'lib/teamlab/modules/projects/projects_files.rb', line 14

def get_message_files(message_id)
  @request.get(['message', message_id.to_s, 'files'])
end

#get_task_files(task_id) ⇒ Object



6
7
8
# File 'lib/teamlab/modules/projects/projects_files.rb', line 6

def get_task_files(task_id)
  @request.get(['task', task_id.to_s, 'files'])
end

#upload_file_to_message(message_id, *files) ⇒ Object



22
23
24
# File 'lib/teamlab/modules/projects/projects_files.rb', line 22

def upload_file_to_message(message_id, *files)
  @request.post(['message', message_id.to_s, 'files'], files: files.flatten)
end

#upload_file_to_task(task_id, *files) ⇒ Object



18
19
20
# File 'lib/teamlab/modules/projects/projects_files.rb', line 18

def upload_file_to_task(task_id, *files)
  @request.post(['task', task_id.to_s, 'files'], files: files.flatten)
end