class Asana::Resources::Attachment

An attachment object represents any file attached to a task in Asana, whether it's an uploaded file or one associated via a third-party service such as Dropbox or Google Drive.

Attributes

created_at[R]
download_url[R]
gid[R]
host[R]
name[R]
parent[R]
resource_type[R]
view_url[R]

Public Class Methods

find_by_id(client, id, options: {}) click to toggle source

Returns the full record for a single attachment.

id - [Gid] Globally unique identifier for the attachment.

options - [Hash] the request I/O options.

# File lib/asana/resources/attachment.rb, line 38
def find_by_id(client, id, options: {})

  self.new(parse(client.get("/attachments/#{id}", options: options)).first, client: client)
end
find_by_task(client, task: required("task"), per_page: 20, options: {}) click to toggle source

Returns the compact records for all attachments on the task.

task - [Gid] Globally unique identifier for the task.

per_page - [Integer] the number of records to fetch per page. options - [Hash] the request I/O options.

# File lib/asana/resources/attachment.rb, line 49
def find_by_task(client, task: required("task"), per_page: 20, options: {})
  params = { limit: per_page }.reject { |_,v| v.nil? || Array(v).empty? }
  Collection.new(parse(client.get("/tasks/#{task}/attachments", params: params, options: options)), type: self, client: client)
end
plural_name() click to toggle source

Returns the plural name of the resource.

# File lib/asana/resources/attachment.rb, line 29
def plural_name
  'attachments'
end