Module: Tr3llo::Command::Card::Archive

Extended by:
Archive
Included in:
Archive
Defined in:
lib/3llo/command/card/archive.rb

Instance Method Summary collapse

Instance Method Details

#execute(key) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/3llo/command/card/archive.rb', line 7

def execute(key)
  card_id = Entities.parse_id(:card, key)
  assert_card_id!(card_id, key)

  interface = Application.fetch_interface!()

  interface.print_frame do
    should_proceed = interface.input.yes?("Are you sure you want to archive this card?")

    if should_proceed
      card = archive_card(card_id)
      interface.puts("Card #{Utils.format_highlight(card.name)} has been archived.")
    end
  end
end