Module: Teamlab::ProjectsComments
- Included in:
- Project
- Defined in:
- lib/teamlab/modules/projects/projects_comments.rb
Overview
Module for projects comments methods
Instance Method Summary collapse
- #add_message_comment(message_id, content, options = {}) ⇒ Object
-
#add_project_comment(entity_id, content, type, options = {}) ⇒ Hash
Adds a project comment with the parameters specified in the request.
- #add_task_comment(task_id, content, options = {}) ⇒ Object
- #delete_comment(comment_id) ⇒ Object
-
#get_a_comment_preview(htmltext, options = {}) ⇒ Hash
Get a preview of a project comment with the ID specified in the request.
- #get_comment(comment_id) ⇒ Object
- #get_message_comments(message_id) ⇒ Object
- #get_task_comments(task_id) ⇒ Object
- #update_comment(comment_id, content) ⇒ Object
Instance Method Details
#add_message_comment(message_id, content, options = {}) ⇒ Object
22 23 24 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 22 def (, content, = {}) @request.post(['message', .to_s, 'comment'], { content: content }.merge()) end |
#add_project_comment(entity_id, content, type, options = {}) ⇒ Hash
Adds a project comment with the parameters specified in the request
39 40 41 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 39 def add_project_comment(entity_id, content, type, = {}) @request.post(%w[comment], { entityid: entity_id, content: content, type: type.to_s }.merge()) end |
#add_task_comment(task_id, content, options = {}) ⇒ Object
18 19 20 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 18 def add_task_comment(task_id, content, = {}) @request.post(['task', task_id.to_s, 'comment'], { content: content }.merge()) end |
#delete_comment(comment_id) ⇒ Object
30 31 32 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 30 def delete_comment(comment_id) @request.delete(['comment', comment_id.to_s]) end |
#get_a_comment_preview(htmltext, options = {}) ⇒ Hash
Get a preview of a project comment with the ID specified in the request
46 47 48 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 46 def get_a_comment_preview(htmltext, = {}) @request.post(%w[comment preview], { htmltext: htmltext }.merge()) end |
#get_comment(comment_id) ⇒ Object
6 7 8 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 6 def get_comment(comment_id) @request.get(['comment', comment_id.to_s]) end |
#get_message_comments(message_id) ⇒ Object
14 15 16 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 14 def () @request.get(['message', .to_s, 'comment']) end |
#get_task_comments(task_id) ⇒ Object
10 11 12 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 10 def get_task_comments(task_id) @request.get(['task', task_id.to_s, 'comment']) end |
#update_comment(comment_id, content) ⇒ Object
26 27 28 |
# File 'lib/teamlab/modules/projects/projects_comments.rb', line 26 def update_comment(comment_id, content) @request.put(['comment', comment_id.to_s], content: content) end |