module Tr3llo::Command::Card::List

Attributes

board_id[R]

Public Instance Methods

execute(board_id) click to toggle source
# 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

Private Instance Methods

get_cards(list_id) click to toggle source
# File lib/3llo/command/card/list.rb, line 34
def get_cards(list_id)
  API::Card.find_all_by_list(list_id)
end
get_lists(board_id) click to toggle source
# File lib/3llo/command/card/list.rb, line 30
def get_lists(board_id)
  API::List.find_all_by_board(board_id)
end