Module: Tr3llo::Command::Card::List

Extended by:
List
Included in:
List
Defined in:
lib/3llo/command/card/list.rb

Instance Method Summary collapse

Instance Method Details

#execute(board_id) ⇒ Object



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

def execute(board_id)
  lists_cards =
    get_lists(board_id)
      .map do |list|
        Thread.new { [list, get_cards(list.id)] }
      end
      .map { |thread| thread.join.value }

  interface = Application.fetch_interface!()

  interface.print_frame do
    interface.puts(
      lists_cards.map do |list, cards|
        View::Card::List.render(list, cards)
      end.join("\n\n\n")
    )
  end
end