From bcc185434af18a3ebea744a8d02f42af7095cdb9 Mon Sep 17 00:00:00 2001 From: Ross Kaffenberger Date: Sat, 19 Dec 2015 11:52:16 -0500 Subject: [PATCH] Document card checklist methods --- lib/tacokit/client/cards.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/tacokit/client/cards.rb b/lib/tacokit/client/cards.rb index 5684c11..e207c4f 100644 --- a/lib/tacokit/client/cards.rb +++ b/lib/tacokit/client/cards.rb @@ -320,6 +320,9 @@ def convert_to_card(card_id, checklist_id, check_item_id) # Start a new checklist on card # @param card_id [String, Tacokit::Resource] the card identifier, shortlink, or card # @param name [String] the new checklist name + # @example Add checklist to card + # card = Tacokit.card("aCardId") + # checklist = Tacokit.add_checklist(card, "Tasks") # @see https://developers.trello.com/advanced-reference/card#post-1-cards-card-id-or-shortlink-checklists def add_checklist(card_id, name) create_card_resource(card_id, "checklists", name: name) @@ -329,9 +332,13 @@ def add_checklist(card_id, name) # Copy another checklist to card # @param card_id [String, Tacokit::Resource] the destination card identifier, shortlink, or card # @param checklist_id [String] the checklist identifier + # card_1 = Tacokit.card("aCardId") + # checklist = card.add_checklist(card_1, "Tasks") + # card_2 = Tacokit.card("bCardId") + # Tacokit.copy_checklist(card_2, checklist) # @see https://developers.trello.com/advanced-reference/card#post-1-cards-card-id-or-shortlink-checklists def copy_checklist(card_id, checklist_id) - create_card_resource(card_id, "checklists", checklist_source_id: checklist_id) + create_card_resource(card_id, "checklists", checklist_source_id: resource_id(checklist_id)) end # Add a member to a card