Class: Wrike3::Comment
Instance Attribute Summary
Attributes included from Common
Instance Method Summary collapse
-
#add(commentable_type, commentable_id, data = {}, options = {}) ⇒ Object
Add a new comment to a task.
-
#delete(id) ⇒ Object
Delete a comment.
-
#details(id, options = {}) ⇒ Object
Returns list of comments.
-
#initialize(wrike) ⇒ Comment
constructor
A new instance of Comment.
-
#list(account_id = nil, options = {}) ⇒ Object
Returns list of comments.
-
#update(id, data = {}, options = {}) ⇒ Object
Update a comment.
Constructor Details
#initialize(wrike) ⇒ Comment
Returns a new instance of Comment.
5 6 7 |
# File 'lib/wrike3/comment.rb', line 5 def initialize(wrike) @wrike = wrike end |
Instance Method Details
#add(commentable_type, commentable_id, data = {}, options = {}) ⇒ Object
Add a new comment to a task
22 23 24 |
# File 'lib/wrike3/comment.rb', line 22 def add(commentable_type, commentable_id, data = {}, ={}) wrike.execute(:post, api_url(nested_path('comments', commentable_type, commentable_id)), .merge(data)) end |
#delete(id) ⇒ Object
Delete a comment
32 33 34 |
# File 'lib/wrike3/comment.rb', line 32 def delete(id) wrike.execute(:delete, api_url("comments/#{id}"), ) end |
#details(id, options = {}) ⇒ Object
Returns list of comments
17 18 19 |
# File 'lib/wrike3/comment.rb', line 17 def details(id, ={}) wrike.execute(:get, api_url("comments/#{id}"), ) end |
#list(account_id = nil, options = {}) ⇒ Object
Returns list of comments
10 11 12 13 14 |
# File 'lib/wrike3/comment.rb', line 10 def list(account_id = nil, ={}) path = 'comments' path = "accounts/#{account_id}/#{path}" if account_id.present? wrike.execute(:get, api_url(path), ) end |
#update(id, data = {}, options = {}) ⇒ Object
Update a comment
27 28 29 |
# File 'lib/wrike3/comment.rb', line 27 def update(id, data = {}, ={}) wrike.execute(:put, api_url("comments/#{id}"), .merge(data)) end |