module Tacokit::Client::Checklists

Public Instance Methods

add_checklist_check_item(checklist_id, name, options = {}) click to toggle source

Add a checklist item to a checklist @param checklist_id [String] the checklist identifier @param name [String] name for the check item @see developers.trello.com/advanced-reference/checklist#post-1-checklists-idchecklist-checkitems

# 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
add_checklist_item(checklist_id, name, options = {})
check_items(checklist_id, options = {}) click to toggle source

Retrieve a checklist's check items @param checklist_id [String] the checklist identifier @param options [Hash] the options to fetch the checklist with @return [Array] the check items collection @see developers.trello.com/advanced-reference/checklist#get-1-checklists-idchecklist-checkitems

# File lib/tacokit/client/checklists.rb, line 36
def check_items(checklist_id, options = {})
  checklist_resource checklist_id, "check_items", options
end
Also aliased as: checklist_check_items
checklist(checklist_id, options = nil) click to toggle source

Retrieve a checklist @param checklist_id [String] the checklist identifier @param options [Hash] options to fetch the checklist with @return [Tacokit::Resource] the checklist resource @see developers.trello.com/advanced-reference/checklist#get-1-checklists-idchecklist

# 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 = {}) click to toggle source

Retrieve the checklist's board @param checklist_id [String] the checklist identifier @param options [Hash] the options to fetch the board with @return [Tacokit::Resource] the board resource @see developers.trello.com/advanced-reference/checklist#get-1-checklists-idchecklist-board

# 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 = {}) click to toggle source

Retrieve a checklist's card @param checklist_id [String] the checklist identifier @param options [Hash] the options to fetch the card with @return [Tacokit::Resource] the card resource @see developers.trello.com/advanced-reference/checklist#get-1-checklists-idchecklist-cards

# File lib/tacokit/client/checklists.rb, line 27
def checklist_card(checklist_id, options = {})
  checklist_resource checklist_id, "card", options
end
checklist_check_item_create(checklist_id, name, options = {})
checklist_check_items(checklist_id, options = {})
Alias for: check_items
checklist_create(card_id, name, options = {})
Alias for: create_checklist
checklist_delete(checklist_id)
Alias for: delete_checklist
checklist_update(checklist_id, options = {})
Alias for: update_checklist
create_checklist(card_id, name, options = {}) click to toggle source

Create a checklist @param card_id [String, Tacokit::Resource<Card>] the card identifier, shortlink, or card @param name [String] name for the checklist @see developers.trello.com/advanced-reference/checklist#post-1-checklists

# 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
Also aliased as: checklist_create
delete_checklist(checklist_id) click to toggle source

Delete a checklist @param checklist_id [String] the checklist identifier @see developers.trello.com/advanced-reference/checklist#delete-1-checklists-idchecklist

# File lib/tacokit/client/checklists.rb, line 73
def delete_checklist(checklist_id)
  delete checklist_path(checklist_id)
end
Also aliased as: checklist_delete
update_checklist(checklist_id, options = {}) click to toggle source

Updates a checklist @param checklist_id [String] the checklist identifier @param options [Hash] the options to update the checklist with @see developers.trello.com/advanced-reference/checklist#put-1-checklists-idchecklist

# File lib/tacokit/client/checklists.rb, line 45
def update_checklist(checklist_id, options = {})
  put checklist_path(checklist_id), options
end
Also aliased as: checklist_update

Private Instance Methods

checklist_path(checklist_id, *paths) click to toggle source
# File lib/tacokit/client/checklists.rb, line 85
def checklist_path(checklist_id, *paths)
  resource_path("checklists", checklist_id, *paths)
end
checklist_resource(checklist_id, resource, *paths) click to toggle source
# File lib/tacokit/client/checklists.rb, line 80
def checklist_resource(checklist_id, resource, *paths)
  paths, options = extract_options(camp(resource), *paths)
  get checklist_path(checklist_id, *paths), options
end