Module: Insightly2::DSL::Comments
- Included in:
- Insightly2::DSL
- Defined in:
- lib/insightly2/dsl/comments.rb
Instance Method Summary collapse
-
#create_comment_attachment(id: nil, filename: nil) ⇒ Faraday::Response
POST /v2.1/Comments?c_id=c_id&filename=filename Adds a file attachment to a comment.
-
#delete_comment(id: nil) ⇒ Faraday::Response
DELETE /v2.1/Comments/id Deletes a comment.
-
#get_comment(id: nil) ⇒ Insightly2::Resources::Comment?
GET /v2.1/Comments/id Get a comment.
-
#update_comment(comment: nil) ⇒ Insightly2::Resources::Comment?
PUT /v2.1/Comments Updates a comment.
Instance Method Details
#create_comment_attachment(id: nil, filename: nil) ⇒ Faraday::Response
POST /v2.1/Comments?c_id=c_id&filename=filename Adds a file attachment to a comment.
21 22 23 24 25 |
# File 'lib/insightly2/dsl/comments.rb', line 21 def (id: nil, filename: nil) raise ArgumentError, "ID cannot be blank" if id.blank? raise ArgumentError, "Filename cannot be blank" if filename.blank? request(:post, "Comments/?c_id=#{id}&filename=#{filename}") end |
#delete_comment(id: nil) ⇒ Faraday::Response
DELETE /v2.1/Comments/id Deletes a comment.
42 43 44 45 |
# File 'lib/insightly2/dsl/comments.rb', line 42 def delete_comment(id: nil) raise ArgumentError, "ID cannot be blank" if id.blank? request(:delete, "Comments/#{id}") end |
#get_comment(id: nil) ⇒ Insightly2::Resources::Comment?
GET /v2.1/Comments/id Get a comment.
10 11 12 13 |
# File 'lib/insightly2/dsl/comments.rb', line 10 def get_comment(id: nil) raise ArgumentError, "ID cannot be blank" if id.blank? Resources::Comment.parse(request(:get, "Comments/#{id}")) end |
#update_comment(comment: nil) ⇒ Insightly2::Resources::Comment?
PUT /v2.1/Comments Updates a comment.
32 33 34 35 |
# File 'lib/insightly2/dsl/comments.rb', line 32 def update_comment(comment: nil) raise ArgumentError, "Comment cannot be blank" if comment.blank? Resources::Comment.parse(request(:put, "Comments", comment)) end |