Class: Trello::Client::Board
- Inherits:
-
Object
- Object
- Trello::Client::Board
- Defined in:
- lib/trello-client/board.rb
Overview
Trello::Client::Board object
Instance Method Summary collapse
-
#[](key) ⇒ Object
Get Trello::Client::Board property.
-
#initialize(board) {|_self| ... } ⇒ Board
constructor
Initialize Trello::Client::Board.
-
#lists ⇒ Object
Get
Arrayof Trello::Client::List objects. -
#to_s ⇒ Object
String representation.
Constructor Details
#initialize(board) {|_self| ... } ⇒ Board
Initialize Trello::Client::Board
Params:
board-
Hash’ified JSON board or JSON string
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 |
#lists ⇒ Object
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 |
#to_s ⇒ Object
String representation.
45 46 47 |
# File 'lib/trello-client/board.rb', line 45 def to_s @board.to_s end |