Class: Asana::Resources::AttachmentsBase
- Defined in:
- lib/asana/resources/gen/attachments_base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.delete_attachment(client, attachment_gid: required("attachment_gid"), options: {}) ⇒ Object
Delete an attachment.
-
.get_attachment(client, attachment_gid: required("attachment_gid"), options: {}) ⇒ Object
Get an attachment.
-
.get_attachments_for_task(client, task_gid: required("task_gid"), options: {}) ⇒ Object
Get attachments for a task.
- .inherited(base) ⇒ Object
Methods inherited from Resource
#initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s
Methods included from ResponseHelper
Constructor Details
This class inherits a constructor from Asana::Resources::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Asana::Resources::Resource
Class Method Details
.delete_attachment(client, attachment_gid: required("attachment_gid"), options: {}) ⇒ Object
Delete an attachment
21 22 23 24 25 |
# File 'lib/asana/resources/gen/attachments_base.rb', line 21 def (client, attachment_gid: required("attachment_gid"), options: {}) path = "/attachments/{attachment_gid}" path["{attachment_gid}"] = parse(client.delete(path, options: )).first end |
.get_attachment(client, attachment_gid: required("attachment_gid"), options: {}) ⇒ Object
Get an attachment
33 34 35 36 37 |
# File 'lib/asana/resources/gen/attachments_base.rb', line 33 def (client, attachment_gid: required("attachment_gid"), options: {}) path = "/attachments/{attachment_gid}" path["{attachment_gid}"] = Attachment.new(parse(client.get(path, options: )).first, client: client) end |
.get_attachments_for_task(client, task_gid: required("task_gid"), options: {}) ⇒ Object
Get attachments for a task
47 48 49 50 51 |
# File 'lib/asana/resources/gen/attachments_base.rb', line 47 def (client, task_gid: required("task_gid"), options: {}) path = "/tasks/{task_gid}/attachments" path["{task_gid}"] = task_gid Collection.new(parse(client.get(path, options: )), type: Attachment, client: client) end |