Class: Trello::Item

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

Overview

An Item is a basic task that can be checked off and marked as completed.

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

#idString (readonly)

Returns:



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

#nameString (readonly)

Returns:



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

#posObject (readonly)

Returns:

  • (Object)


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

#stateObject (readonly)

Returns:

  • (Object)


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

#typeObject (readonly)

Returns:

  • (Object)


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