module Tr3llo::Command::List::Cards

Public Instance Methods

execute(list_key) click to toggle source
# File lib/3llo/command/list/cards.rb, line 7
def execute(list_key)
  list_id = Entities.parse_id(:list, list_key)
  assert_list_id!(list_id, list_key)

  cards = list_cards(list_id)

  interface.print_frame do
    interface.puts(View::List::Cards.render(cards))
  end
end

Private Instance Methods

assert_list_id!(list_id, list_key) click to toggle source
# File lib/3llo/command/list/cards.rb, line 28
def assert_list_id!(list_id, list_key)
  raise InvalidArgumentError.new("#{list_key.inspect} is not a valid list key") unless list_id
end
interface() click to toggle source
# File lib/3llo/command/list/cards.rb, line 24
def interface
  Application.fetch_interface!()
end
list_cards(list_id) click to toggle source
# File lib/3llo/command/list/cards.rb, line 20
def list_cards(list_id)
  API::Card.find_all_by_list(list_id)
end