module Tr3llo::Command::Card::AddChecklist

Public Instance Methods

execute(card_key) click to toggle source
# File lib/3llo/command/card/add_checklist.rb, line 7
def execute(card_key)
  card_id = Entities.parse_id(:card, card_key)
  interface = Application.fetch_interface!()

  interface.print_frame do
    name = interface.input.ask("Checklist name:", required: true)

    API::Checklist.create(card_id, name: name)

    interface.puts("Item #{name.inspect} has been added")
  end
end