Module: Tr3llo::API::Board

Extended by:
Board
Included in:
Board
Defined in:
lib/3llo/api/board.rb

Instance Method Summary collapse

Instance Method Details

#create(name:, desc:, default_lists: true) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/3llo/api/board.rb', line 28

def create(name:, desc:, default_lists: true)
  client = Application.fetch_client!()
  req_path = Utils.build_req_path("/boards", {})
  payload = {
    "name" => name,
    "desc" => desc,
    "defaultLists" => default_lists
  }

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

#find(board_id) ⇒ Object



21
22
23
24
25
26
# File 'lib/3llo/api/board.rb', line 21

def find(board_id)
  client = Application.fetch_client!()
  req_path = Utils.build_req_path("/boards/#{board_id}")

  make_struct(client.get(req_path, {}))
end

#find_all_by_user(user_id) ⇒ Object



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

def find_all_by_user(user_id)
  client = Application.fetch_client!()
  req_path =
    Utils.build_req_path(
      "/members/#{user_id}/boards",
      {"filter" => "open"}
    )

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