Class: Trello::CheckItemState

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

Overview

Represents the state of an item.

Instance Attribute Summary

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

Constructor Details

This class inherits a constructor from Trello::BasicData

Instance Method Details

#itemObject

Return the item this state belongs to.



19
20
21
# File 'lib/trello/item_state.rb', line 19

def item
  Item.find(item_id)
end

#update_fields(fields) ⇒ Object

Update the fields of an item state.

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



11
12
13
14
15
16
# File 'lib/trello/item_state.rb', line 11

def update_fields(fields)
  attributes[:id]      = fields['id']
  attributes[:state]   = fields['state']
  attributes[:item_id] = fields['idCheckItem']
  self
end