Class: Trello::ItemState
- Defined in:
- lib/trello/item_state.rb
Overview
Represents the state of an item.
Instance Method Summary collapse
-
#item ⇒ Object
Return the item this state belongs to.
-
#update_fields(fields) ⇒ Object
Update the fields of an item state.
Methods inherited from BasicData
#==, find, #initialize, many, one, #refresh!, register_attributes
Constructor Details
This class inherits a constructor from Trello::BasicData
Instance Method Details
#item ⇒ Object
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['idItem'] self end |