Class: Trello::Item
Overview
An Item is a basic task that can be checked off and marked as completed.
Instance Attribute Summary collapse
- #id ⇒ String readonly
- #name ⇒ String readonly
- #pos ⇒ Object readonly
- #state ⇒ Object readonly
- #type ⇒ Object readonly
Attributes inherited from BasicData
Instance Method Summary collapse
-
#update_fields(fields) ⇒ Object
Updates the fields of an item.
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 Attribute Details
#id ⇒ String (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/trello/item.rb', line 14 class Item < BasicData register_attributes :id, :name, :type, :state, :pos, readonly: [ :id, :name, :type, :state, :pos ] validates_presence_of :id, :type # Updates the fields of an item. # # Supply a hash of string keyed data retrieved from the Trello API representing # an item. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:type] = fields['type'] attributes[:state] = fields['state'] attributes[:pos] = fields['pos'] self end end |
#name ⇒ String (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/trello/item.rb', line 14 class Item < BasicData register_attributes :id, :name, :type, :state, :pos, readonly: [ :id, :name, :type, :state, :pos ] validates_presence_of :id, :type # Updates the fields of an item. # # Supply a hash of string keyed data retrieved from the Trello API representing # an item. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:type] = fields['type'] attributes[:state] = fields['state'] attributes[:pos] = fields['pos'] self end end |
#pos ⇒ Object (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/trello/item.rb', line 14 class Item < BasicData register_attributes :id, :name, :type, :state, :pos, readonly: [ :id, :name, :type, :state, :pos ] validates_presence_of :id, :type # Updates the fields of an item. # # Supply a hash of string keyed data retrieved from the Trello API representing # an item. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:type] = fields['type'] attributes[:state] = fields['state'] attributes[:pos] = fields['pos'] self end end |
#state ⇒ Object (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/trello/item.rb', line 14 class Item < BasicData register_attributes :id, :name, :type, :state, :pos, readonly: [ :id, :name, :type, :state, :pos ] validates_presence_of :id, :type # Updates the fields of an item. # # Supply a hash of string keyed data retrieved from the Trello API representing # an item. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:type] = fields['type'] attributes[:state] = fields['state'] attributes[:pos] = fields['pos'] self end end |
#type ⇒ Object (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/trello/item.rb', line 14 class Item < BasicData register_attributes :id, :name, :type, :state, :pos, readonly: [ :id, :name, :type, :state, :pos ] validates_presence_of :id, :type # Updates the fields of an item. # # Supply a hash of string keyed data retrieved from the Trello API representing # an item. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:type] = fields['type'] attributes[:state] = fields['state'] attributes[:pos] = fields['pos'] self end end |
Instance Method Details
#update_fields(fields) ⇒ Object
Updates the fields of an item.
Supply a hash of string keyed data retrieved from the Trello API representing an item.
22 23 24 25 26 27 28 29 |
# File 'lib/trello/item.rb', line 22 def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:type] = fields['type'] attributes[:state] = fields['state'] attributes[:pos] = fields['pos'] self end |