Module: Tr3llo::Command::Card::AddChecklist

Extended by:
AddChecklist
Included in:
AddChecklist
Defined in:
lib/3llo/command/card/add_checklist.rb

Instance Method Summary collapse

Instance Method Details

#execute(card_key) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# 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