Class: Trello::Label

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

Overview

A colored Label attached to a card

Instance Attribute Summary collapse

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 Attribute Details

#colorString

Returns:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/trello/label.rb', line 9

class Label < BasicData
  register_attributes :name, :color

  # Update the fields of a label.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # a label.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:color] = fields['color']
    self
  end

end

#idString

Returns:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/trello/label.rb', line 9

class Label < BasicData
  register_attributes :name, :color

  # Update the fields of a label.
  #
  # Supply a hash of stringkeyed data retrieved from the Trello API representing
  # a label.
  def update_fields(fields)
    attributes[:name]  = fields['name']
    attributes[:color] = fields['color']
    self
  end

end

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.



16
17
18
19
20
# File 'lib/trello/label.rb', line 16

def update_fields(fields)
  attributes[:name]  = fields['name']
  attributes[:color] = fields['color']
  self
end