Class: Trello::LabelName
- Defined in:
- lib/trello/label_name.rb
Overview
A colored Label attached to a card
Instance Attribute Summary
Attributes inherited from BasicData
Instance Method Summary collapse
-
#update_fields(fields) ⇒ Object
Update the fields of a label.
Methods inherited from BasicData
#==, client, create, find, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attributes, save
Methods included from JsonUtils
Constructor Details
This class inherits a constructor from Trello::BasicData
Instance Method Details
#update_fields(fields) ⇒ Object
Update the fields of a label.
Supply a hash of stringkeyed data retrieved from the Trello API representing a label.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/trello/label_name.rb', line 11 def update_fields(fields) attributes[:yellow] = fields['yellow'] || attributes[:yellow] attributes[:red] = fields['red'] || attributes[:red] attributes[:orange] = fields['orange'] || attributes[:orange] attributes[:green] = fields['green'] || attributes[:green] attributes[:purple] = fields['purple'] || attributes[:purple] attributes[:blue] = fields['blue'] || attributes[:blue] attributes[:sky] = fields['sky'] || attributes[:sky] attributes[:pink] = fields['pink'] || attributes[:pink] attributes[:lime] = fields['lime'] || attributes[:lime] attributes[:black] = fields['black'] || attributes[:black] self end |