Class: Trello::Attachment
Overview
A file or url that is linked to a Trello card
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
Methods included from JsonUtils
included
Instance Attribute Details
#bytes ⇒ Fixnum
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/trello/attachment.rb', line 18
class Attachment < BasicData
register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type, :previews
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']
attributes[:previews] = fields['previews']
self
end
end
|
#date ⇒ Datetime
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/trello/attachment.rb', line 18
class Attachment < BasicData
register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type, :previews
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']
attributes[:previews] = fields['previews']
self
end
end
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/trello/attachment.rb', line 18
class Attachment < BasicData
register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type, :previews
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']
attributes[:previews] = fields['previews']
self
end
end
|
#is_upload ⇒ Boolean
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/trello/attachment.rb', line 18
class Attachment < BasicData
register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type, :previews
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']
attributes[:previews] = fields['previews']
self
end
end
|
#mime_type ⇒ String
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/trello/attachment.rb', line 18
class Attachment < BasicData
register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type, :previews
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']
attributes[:previews] = fields['previews']
self
end
end
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/trello/attachment.rb', line 18
class Attachment < BasicData
register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type, :previews
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']
attributes[:previews] = fields['previews']
self
end
end
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/trello/attachment.rb', line 18
class Attachment < BasicData
register_attributes :name, :id, :url, :bytes, :member_id, :date, :is_upload, :mime_type, :previews
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']
attributes[:previews] = fields['previews']
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
35
|
# 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']
attributes[:previews] = fields['previews']
self
end
|