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

Method Summary

Methods inherited from BasicData

#==, #attributes, client, #collection_name, #collection_path, create, #element_name, #element_path, find, #hash, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attrs, #save, save, schema, #schema, #update!, #update_fields

Methods included from JsonUtils

included

Constructor Details

This class inherits a constructor from Trello::BasicData

Instance Attribute Details

#bytes ⇒ Fixnum (readonly)

Returns:

  • (Fixnum)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#date ⇒ Datetime (readonly)

Returns:

  • (Datetime)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#edge_color ⇒ String (readonly)

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#file=(value) ⇒ String (writeonly)

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#file_name ⇒ String (readonly)

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#id ⇒ String (readonly)

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#is_upload ⇒ Boolean (readonly)

Returns:

  • (Boolean)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#member_id ⇒ String (readonly)

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#mime_type ⇒ String

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#name ⇒ String

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#position ⇒ Float (readonly)

Returns:

  • (Float)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#previews ⇒ Array (readonly)

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#set_as_cover=(value) ⇒ Boolean (writeonly)

Returns:

  • (Boolean)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end

#url ⇒ String

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/trello/attachment.rb', line 32

class Attachment < BasicData
  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :position, readonly: true, remote_key: 'pos'
    attribute :bytes, readonly: true
    attribute :member_id, remote_key: 'idMember', readonly: true
    attribute :date, serializer: 'Time', readonly: true
    attribute :is_upload, remote_key: 'isUpload', readonly: true
    attribute :previews, readonly: true
    attribute :file_name, remote_key: 'fileName', readonly: true
    attribute :edge_color, remote_key: 'edgeColor', readonly: true

    # Writable but create only
    attribute :name, create_only: true
    attribute :url, create_only: true
    attribute :mime_type, remote_key: 'mimeType', create_only: true
    attribute :file, create_only: true
    attribute :set_as_cover, remote_key: 'setCover', create_only: true
  end
end