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

#bytesFixnum (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

#dateDatetime (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_colorString (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_nameString (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

#idString (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_uploadBoolean (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_idString (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_typeString

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

#nameString

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

#positionFloat (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

#previewsArray (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

#urlString

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