class Client

Attributes

board[RW]
cards[RW]
labels[RW]
lists[RW]

Public Class Methods

new(board_id:, key:, token:) click to toggle source
# File lib/trellist/client.rb, line 43
def initialize(board_id:, key:, token:)
  @board = board_id
  @key = key
  @token = token

  Trello.configure do |config|
    config.developer_public_key = key
    config.member_token = token
  end
end

Public Instance Methods

board_labels() click to toggle source
# File lib/trellist/client.rb, line 58
def board_labels
  @labels = Trello::Board.find(@board).labels
end
get_board_lists() click to toggle source
# File lib/trellist/client.rb, line 54
def get_board_lists
  @lists = Trello::Board.find(@board).lists
end
list_cards(list_id, label: nil) click to toggle source
# File lib/trellist/client.rb, line 62
def list_cards(list_id, label: nil)
  @cards = Trello::List.find(list_id).cards
  @cards.select! { |card| card.labels.map(&:name).include?(label) } if label
end