class Trello::Attachment
A file or url that is linked to a Trello
card
@!attribute id
@return [String]
@!attribute name
@return [String]
@!attribute url
@return [String]
@!attribute pos
@return [Float]
@!attribute bytes
@return [Fixnum]
@!attribute date
@return [Datetime]
@!attribute is_upload
@return [Boolean]
@!attribute mime_type
@return [String]
Public Instance Methods
update_fields(fields)
click to toggle source
Update the fields of an attachment.
Supply a hash of stringkeyed data retrieved from the Trello
API representing an attachment.
# File lib/trello/attachment.rb, line 26 def update_fields(fields) attributes[:name] = fields['name'] attributes[:id] = fields['id'] attributes[:pos] = fields['pos'] 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'] attributes[:previews] = fields['previews'] self end