Class: Trello::Client::Board

Inherits:
Object
  • Object
show all
Defined in:
lib/trello-client/board.rb

Overview

Trello::Client::Board object

See trello.com/docs/api/board/index.html

Instance Method Summary collapse

Constructor Details

#initialize(board) {|_self| ... } ⇒ Board

Initialize Trello::Client::Board

Params:

board

Hash’ified JSON board or JSON string

Yields:

  • (_self)

Yield Parameters:



19
20
21
22
23
# File 'lib/trello-client/board.rb', line 19

def initialize(board)
  @board = board.kind_of?(Hash) ? board : MultiJson.decode(board)
  yield self if block_given?
  self
end

Instance Method Details

#[](key) ⇒ Object

Get Trello::Client::Board property



28
29
30
# File 'lib/trello-client/board.rb', line 28

def[](key)
  @board[key]
end

#listsObject

Get Array of Trello::Client::List objects



35
36
37
38
39
40
# File 'lib/trello-client/board.rb', line 35

def lists
  unless @lists
    @lists = ( @board['lists'] || []  ).collect { |l| Trello::Client::List.new(l) }
  end
  @lists
end