module Tacokit::Client::Checklists
Public Instance Methods
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
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
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
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
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
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
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
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
Private Instance Methods
# File lib/tacokit/client/checklists.rb, line 85 def checklist_path(checklist_id, *paths) resource_path("checklists", checklist_id, *paths) end
# 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