class Trello::Item

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

@!attribute [r] id

@return [String]

@!attribute [r] name

@return [String]

@!attribute [r] type

@return [Object]

@!attribute [r] state

@return [Object]

@!attribute [r] pos

@return [Object]

Public Instance Methods

complete?() click to toggle source
# File lib/trello/item.rb, line 33
def complete?
  state == "complete"
end
update_fields(fields) click to toggle source

Updates the fields of an item.

Supply a hash of string keyed data retrieved from the Trello API representing an item.

# File lib/trello/item.rb, line 22
def update_fields(fields)
  attributes[:id]           = fields['id'] || attributes[:id]
  attributes[:card_id]      = fields['idCard'] || attributes[:card_id]
  attributes[:checklist_id] = fields['idChecklist'] || attributes[:checklist_id]
  attributes[:name]         = fields['name'] || attributes[:name]
  attributes[:type]         = fields['type'] || attributes[:type]
  attributes[:state]        = fields['state'] || attributes[:state]
  attributes[:pos]          = fields['pos'] || attributes[:pos]
  self
end