Module: Tacokit::Client::Checklists

Included in:
Tacokit::Client
Defined in:
lib/tacokit/client/checklists.rb

Instance Method Summary collapse

Instance Method Details

#add_checklist_check_item(checklist_id, name, options = {}) ⇒ Object Also known as: checklist_check_item_create, add_checklist_item

Add a checklist item to a checklist

Parameters:

  • checklist_id (String)

    the checklist identifier

  • name (String)

    name for the check item

See Also:


64
65
66
# File 'lib/tacokit/client/checklists.rb', line 64

def add_checklist_check_item(checklist_id, name, options = {})
  post checklist_path(checklist_id, "checkItems"), options.merge(name: name)
end

#check_items(checklist_id, options = {}) ⇒ Array Also known as: checklist_check_items

Retrieve a checklist's check items

Parameters:

  • checklist_id (String)

    the checklist identifier

  • options (Hash) (defaults to: {})

    the options to fetch the checklist with

Returns:

  • (Array)

    the check items collection

See Also:


36
37
38
# File 'lib/tacokit/client/checklists.rb', line 36

def check_items(checklist_id, options = {})
  checklist_resource checklist_id, "check_items", options
end

#checklist(checklist_id, options = nil) ⇒ Tacokit::Resource

Retrieve a checklist

Parameters:

  • checklist_id (String)

    the checklist identifier

  • options (Hash) (defaults to: nil)

    options to fetch the checklist with

Returns:

See Also:


9
10
11
# File 'lib/tacokit/client/checklists.rb', line 9

def checklist(checklist_id, options = nil)
  get checklist_path(checklist_id), options
end

#checklist_board(checklist_id, options = {}) ⇒ Tacokit::Resource

Retrieve the checklist's board

Parameters:

  • checklist_id (String)

    the checklist identifier

  • options (Hash) (defaults to: {})

    the options to fetch the board with

Returns:

See Also:


18
19
20
# File 'lib/tacokit/client/checklists.rb', line 18

def checklist_board(checklist_id, options = {})
  checklist_resource checklist_list_id, "board", options
end

#checklist_card(checklist_id, options = {}) ⇒ Tacokit::Resource

Retrieve a checklist's card

Parameters:

  • checklist_id (String)

    the checklist identifier

  • options (Hash) (defaults to: {})

    the options to fetch the card with

Returns:

See Also:


27
28
29
# File 'lib/tacokit/client/checklists.rb', line 27

def checklist_card(checklist_id, options = {})
  checklist_resource checklist_id, "card", options
end

#create_checklist(card_id, name, options = {}) ⇒ Object Also known as: checklist_create

Create a checklist

Parameters:

  • card_id (String, Tacokit::Resource<Card>)

    the card identifier, shortlink, or card

  • name (String)

    name for the checklist

See Also:


54
55
56
57
# File 'lib/tacokit/client/checklists.rb', line 54

def create_checklist(card_id, name, options = {})
  options.update card_id: card_id, name: name
  post "checklists", options
end

#delete_checklist(checklist_id) ⇒ Object Also known as: checklist_delete

Delete a checklist

Parameters:

  • checklist_id (String)

    the checklist identifier

See Also:


73
74
75
# File 'lib/tacokit/client/checklists.rb', line 73

def delete_checklist(checklist_id)
  delete checklist_path(checklist_id)
end

#update_checklist(checklist_id, options = {}) ⇒ Object Also known as: checklist_update

Updates a checklist

Parameters:

  • checklist_id (String)

    the checklist identifier

  • options (Hash) (defaults to: {})

    the options to update the checklist with

See Also:


45
46
47
# File 'lib/tacokit/client/checklists.rb', line 45

def update_checklist(checklist_id, options = {})
  put checklist_path(checklist_id), options
end