Module: Tacokit::Client::Boards

Included in:
Tacokit::Client
Defined in:
lib/tacokit/client/boards.rb

Overview

Methods for the Boards API

See Also:

Instance Method Summary (collapse)

Instance Method Details

- (Object) add_board_member(board_id, email, full_name, options = {})

Add a member to a board

Examples:

Add your friend Susan as an admin to your board

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.add_board_member(board, "[email protected]", "Susan Example", type: "admin")

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • email (String)

    an email address of the member to add

  • full_name (String)

    the full name of the member to add

  • options (Hash) (defaults to: {})

    options to modify the membership with

See Also:



168
169
170
171
172
173
# File 'lib/tacokit/client/boards.rb', line 168

def add_board_member(board_id, email, full_name, options = {})
  options.update \
    email: email,
    full_name: full_name
  put board_path(board_id, "members"), options
end

- (Tacokit::Resource<Board>) board(board_id, options = nil)

Retrieve a board

Examples:

fetch a board

Tacokit.board("aBoardId") #=> Tacokit::Resource<Board>

fetch a board with all its cards

Tacokit.member("aBoardId", cards: "all") #=> Tacokit::Resource<Board>

configure a local client, fetch a board with a subset of attributes

client = Tacokit::Client.new app_key: "another-app-key"
client.board('aBoardId', fields: %w[name shortUrl desc]) #=> Tacokit::Resource<Board>

Parameters:

  • board_id (String)

    the board identifier

Returns:

See Also:



17
18
19
# File 'lib/tacokit/client/boards.rb', line 17

def board(board_id, options = nil)
  get board_path(board_id), options
end

- (Tacokit::Collection<Action>) board_actions(board_id, options = {})

Retrieve a board's actions

Examples:

fetch “create card” actions for a given board

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_actions(board, filter: "create_card") #=> Tacokit::Collection<Action>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the actions with

Returns:

See Also:



29
30
31
# File 'lib/tacokit/client/boards.rb', line 29

def board_actions(board_id, options = {})
  paginated_board_resource(board_id, "actions", options)
end

- (Tacokit::Collection<Card>) board_cards(board_id, options = {})

Retrieve a board's cards

Examples:

fetch board cards

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_cards(board) #=> Tacokit::Collection<Card>

fetch board cards with attachments, members, stickers

Tacokit.board_cards(board, attachments: true, members: true, stickers: true) #=> Tacokit::Collection<Card>

configure a local client, fetch a board“s cards with a subset of attributes

client = Tacokit::Client.new app_key: "another-app-key"
client.board_cards("aBoardId") #=> Tacokit::Collection<Card>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the cards with

Returns:

See Also:



58
59
60
# File 'lib/tacokit/client/boards.rb', line 58

def board_cards(board_id, options = {})
  paginated_board_resource(board_id, "cards", options)
end

- (Tacokit::Collection<Checklist>) board_checklists(board_id, options = {})

Retrieve a board's checklists

Examples:

fetch board checklists

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_checklists(board) #=> Tacokit::Collection<Checklist>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the checklists with

Returns:

See Also:



70
71
72
# File 'lib/tacokit/client/boards.rb', line 70

def board_checklists(board_id, options = {})
  board_resource(board_id, "checklists", options)
end

- (Tacokit::Collection<Label>) board_labels(board_id, options = {})

Retrieve a board's labels

Examples:

fetch board's first 50 (default) labels

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_labels(board) #=> Tacokit::Collection<Label>

fetch board's first 100 labels

Tacokit.board_labels(board, limit: 100) #=> Tacokit::Collection<Label>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the labels with

Returns:

See Also:



84
85
86
# File 'lib/tacokit/client/boards.rb', line 84

def board_labels(board_id, options = {})
  board_resource(board_id, "labels", options)
end

- (Tacokit::Collection<Member>) board_members(board_id, options = {})

Retrieve a board's members

Examples:

fetch board's members

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_members(board) #=> Tacokit::Collection<Member>

fetch board's members with selected attributes

Tacokit.board_members(board, fields: %w[username url avatar_hash]) #=> Tacokit::Collection<Member>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the members with

Returns:

See Also:



116
117
118
# File 'lib/tacokit/client/boards.rb', line 116

def board_members(board_id, options = {})
  board_resource(board_id, "members", options)
end

- (Tacokit::Collection) board_organization(board_id, options = {})

Retrieve a board's organization

Examples:

fetch board's organization

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_organization(board) #=> Tacokit::Resource<Organization>

fetch board's organization with selected attributes

Tacokit.board_organization(board, fields: %w[name url website]) #=> Tacokit::Resource<Organization>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the organizations with

Returns:

See Also:



142
143
144
# File 'lib/tacokit/client/boards.rb', line 142

def board_organization(board_id, options = {})
  board_resource(board_id, "organization", options)
end

- (Tacokit::Collection) board_preferences(board_id, options = {})

Retrieve your preferences for a board

Examples:

fetch board's preferences

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_preferences(board) #=> Tacokit::Collection<Preference>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the preferences with

Returns:

See Also:



128
129
130
# File 'lib/tacokit/client/boards.rb', line 128

def board_preferences(board_id, options = {})
  board_resource(board_id, "my_prefs", options)
end

- (Tacokit::Collection<Star>) board_stars(board_id, options = {})

Retrieve a board's stars

Examples:

fetch board stars

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_stars(board) #=> Tacokit::Collection<Star>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the stars with

Returns:

See Also:



41
42
43
# File 'lib/tacokit/client/boards.rb', line 41

def board_stars(board_id, options = {})
  board_resource(board_id, "board_stars", options)
end

- (Object) create_board(name, options = {})

Create a board

Examples:

Create a board named “Holiday Shopping”

Tacokit.create_board("Holiday Shopping")

Create a board named “Project B” copied from another board with a new organization and description

Tacokit.create_board("Project B", board_source_id: "projectASourceIdentifier", organization_id: "anOrgId", desc: "A cloned board!")

Parameters:

  • name (String)

    the new board name

  • options (Hash) (defaults to: {})

    options to create the board with

See Also:



196
197
198
# File 'lib/tacokit/client/boards.rb', line 196

def create_board(name, options = {})
  post "boards", options.merge(name: name)
end

- (Tacokit::Collection<List>) lists(board_id, options = {}) Also known as: board_lists

Retrieve a board's lists

Examples:

fetch open board lists

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.board_lists(board) #=> Tacokit::Collection<List>

fetch all board lists with open cards

Tacokit.board_lists(board, filter: "all", cards: "open") #=> Tacokit::Collection<List>

configure a local client, fetch a board's open lists with lists names and pos

client = Tacokit::Client.new app_key: "another-app-key"
client.board_lists(board, fields: %w[name pos]) #=> Tacokit::Resource<List>

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the options to fetch the lists with

Returns:

See Also:



101
102
103
# File 'lib/tacokit/client/boards.rb', line 101

def lists(board_id, options = {})
  board_resource(board_id, "lists", options)
end

- (Object) update_board(board_id, options = {})

Update board attributes

Examples:

Update a board's name and description

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
Tacokit.update_board(board, name: "New Board Name", desc: "For realz this time")

Open a closed board

Tacokit.update_board(board, closed: false)

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • options (Hash) (defaults to: {})

    the attributes to update on the board

See Also:



155
156
157
# File 'lib/tacokit/client/boards.rb', line 155

def update_board(board_id, options = {})
  put board_path(board_id), options
end

- (Object) update_board_member(board_id, member_id, type)

Update a board member's type

Examples:

Demote your friend Larry to a member with “normal” membership privileges

board = Tacokit.client("aBoardId") #=> Tacokit::Resource<Board>
larry = Tacokit.member("someMemberNamedLarry") #=> Tacokit::Resource<Member>
Tacokit.update_board_member(board, larry, "normal")

Parameters:

  • board_id (String, Tacokit::Resource<Board>)

    the board identifier or board

  • member_id (String)

    the member identifier

  • type (String)

    the membership type to change to

See Also:



184
185
186
# File 'lib/tacokit/client/boards.rb', line 184

def update_board_member(board_id, member_id, type)
  update_board_resource(board_id, "members", resource_id(member_id), type: type)
end