Class: Trello::Attachment

Inherits:
BasicData show all
Defined in:
lib/trello/attachment.rb

Overview

A file or url that is linked to a Trello card

Direct Known Subclasses

CoverImage

Instance Attribute Summary collapse

Attributes inherited from BasicData

#client

Instance Method Summary collapse

Methods inherited from BasicData

#==, client, create, find, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attributes, save

Constructor Details

This class inherits a constructor from Trello::BasicData

Instance Attribute Details

#bytesFixnum

Returns:

  • (Fixnum)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/trello/attachment.rb', line 18

class Attachment < BasicData
  register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type
  # Update the fields of an attachment.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # an attachment.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:id] = fields['id']
    attributes[:url] = fields['url']
    attributes[:bytes] = fields['bytes'].to_i
    attributes[:member_id] = fields['idMember']
    attributes[:date] = Time.parse(fields['date'])
    attributes[:is_upload] = fields['isUpload']
    attributes[:mime_type] = fields['mimeType']
    self
  end
end

#dateDatetime

Returns:

  • (Datetime)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/trello/attachment.rb', line 18

class Attachment < BasicData
  register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type
  # Update the fields of an attachment.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # an attachment.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:id] = fields['id']
    attributes[:url] = fields['url']
    attributes[:bytes] = fields['bytes'].to_i
    attributes[:member_id] = fields['idMember']
    attributes[:date] = Time.parse(fields['date'])
    attributes[:is_upload] = fields['isUpload']
    attributes[:mime_type] = fields['mimeType']
    self
  end
end

#idString

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/trello/attachment.rb', line 18

class Attachment < BasicData
  register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type
  # Update the fields of an attachment.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # an attachment.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:id] = fields['id']
    attributes[:url] = fields['url']
    attributes[:bytes] = fields['bytes'].to_i
    attributes[:member_id] = fields['idMember']
    attributes[:date] = Time.parse(fields['date'])
    attributes[:is_upload] = fields['isUpload']
    attributes[:mime_type] = fields['mimeType']
    self
  end
end

#is_uploadBoolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/trello/attachment.rb', line 18

class Attachment < BasicData
  register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type
  # Update the fields of an attachment.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # an attachment.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:id] = fields['id']
    attributes[:url] = fields['url']
    attributes[:bytes] = fields['bytes'].to_i
    attributes[:member_id] = fields['idMember']
    attributes[:date] = Time.parse(fields['date'])
    attributes[:is_upload] = fields['isUpload']
    attributes[:mime_type] = fields['mimeType']
    self
  end
end

#mime_typeString

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/trello/attachment.rb', line 18

class Attachment < BasicData
  register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type
  # Update the fields of an attachment.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # an attachment.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:id] = fields['id']
    attributes[:url] = fields['url']
    attributes[:bytes] = fields['bytes'].to_i
    attributes[:member_id] = fields['idMember']
    attributes[:date] = Time.parse(fields['date'])
    attributes[:is_upload] = fields['isUpload']
    attributes[:mime_type] = fields['mimeType']
    self
  end
end

#nameString

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/trello/attachment.rb', line 18

class Attachment < BasicData
  register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type
  # Update the fields of an attachment.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # an attachment.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:id] = fields['id']
    attributes[:url] = fields['url']
    attributes[:bytes] = fields['bytes'].to_i
    attributes[:member_id] = fields['idMember']
    attributes[:date] = Time.parse(fields['date'])
    attributes[:is_upload] = fields['isUpload']
    attributes[:mime_type] = fields['mimeType']
    self
  end
end

#urlString

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/trello/attachment.rb', line 18

class Attachment < BasicData
  register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type
  # Update the fields of an attachment.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # an attachment.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:id] = fields['id']
    attributes[:url] = fields['url']
    attributes[:bytes] = fields['bytes'].to_i
    attributes[:member_id] = fields['idMember']
    attributes[:date] = Time.parse(fields['date'])
    attributes[:is_upload] = fields['isUpload']
    attributes[:mime_type] = fields['mimeType']
    self
  end
end

Instance Method Details

#update_fields(fields) ⇒ Object

Update the fields of an attachment.

Supply a hash of stringkeyed data retrieved from the Trello API representing an attachment.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/trello/attachment.rb', line 24

def update_fields(fields)
  attributes[:name]  = fields['name']
  attributes[:id] = fields['id']
  attributes[:url] = fields['url']
  attributes[:bytes] = fields['bytes'].to_i
  attributes[:member_id] = fields['idMember']
  attributes[:date] = Time.parse(fields['date'])
  attributes[:is_upload] = fields['isUpload']
  attributes[:mime_type] = fields['mimeType']
  self
end