Class: Trello::CustomFieldOption

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

Overview

A custom field option contains the individual items in a custom field dropdown menu.

Instance Attribute Summary

Attributes inherited from BasicData

#client

Instance Method Summary collapse

Methods inherited from BasicData

#==, client, create, find, #hash, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attributes, save

Methods included from JsonUtils

included

Constructor Details

This class inherits a constructor from Trello::BasicData

Instance Method Details

#update_fields(fields) ⇒ Object

Update the fields of a custom field option.

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



13
14
15
16
17
18
19
20
# File 'lib/trello/custom_field_option.rb', line 13

def update_fields(fields)
  attributes[:id]               = fields['_id'] || fields[:id] || attributes[:id]
  attributes[:color]            = fields['color'] || fields[:color] || attributes[:color]
  attributes[:pos]              = fields['pos'] || fields[:pos] || attributes[:pos]
  # value format: { "text": "hello world" }
  attributes[:value]            = fields['value'] || fields[:value] || attributes[:value]
  self
end