Class: Trello::Item

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

Overview

An Item is a basic task that can be checked off and marked as completed.

Instance Attribute Summary collapse

Attributes inherited from BasicData

#client

Instance Method Summary collapse

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

#checked=(value) ⇒ Boolean (writeonly)

Returns:

  • (Boolean)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#checklist_idString (readonly)

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#due_dateDatetime (readonly)

Returns:

  • (Datetime)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#idString (readonly)

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#member_idString (readonly)

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#nameString (readonly)

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#name_dataString (readonly)

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#positionObject (readonly)

Returns:

  • (Object)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#stateObject (readonly)

Returns:

  • (Object)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

#typeObject (readonly)

Returns:

  • (Object)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/trello/item.rb', line 24

class Item < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :type, readonly: true
    attribute :name_data, readonly: true, remote_key: 'nameData'
    attribute :due_date, readonly: true, remote_key: 'due', serializer: 'Time'
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :state, readonly: true
    attribute :checklist_id, readonly: true, remote_key: 'idChecklist'

    # Writable and write only
    attribute :name, write_only: true
    attribute :position, write_only: true, remote_key: 'pos'
    attribute :checked, write_only: true
  end

  validates_presence_of :id

  def complete?
    state == "complete"
  end
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/trello/item.rb', line 44

def complete?
  state == "complete"
end