Module: Tr3llo::API::List

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

Instance Method Summary collapse

Instance Method Details

#archive_cards(list_id) ⇒ Object



20
21
22
23
24
# File 'lib/3llo/api/list.rb', line 20

def archive_cards(list_id)
  req_path = Utils.build_req_path("/lists/#{list_id}/archiveAllCards")

  client.post(req_path, {}, {})
end

#create(name, board_id) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/3llo/api/list.rb', line 26

def create(name, board_id)
  req_path = Utils.build_req_path("/lists")
  payload = {
    "name" => name,
    "idBoard" => board_id
  }

  client.post(req_path, {}, payload)
end

#find_all_by_board(board_id) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/3llo/api/list.rb', line 6

def find_all_by_board(board_id)
  req_path =
    Utils.build_req_path(
      "/boards/#{board_id}/lists",
      {"list" => "true"}
    )

  client
    .get(req_path, {})
    .map do |list_payload|
      make_struct(list_payload)
    end
end