Class: Trello::Client::List
- Inherits:
-
Object
- Object
- Trello::Client::List
- Defined in:
- lib/trello-client/list.rb
Overview
Trello::Client::List object
Instance Method Summary collapse
-
#[](key) ⇒ Object
Get Trello::Client::List property.
-
#cards ⇒ Object
TODO Get
Array
of cards. -
#initialize(list) {|_self| ... } ⇒ List
constructor
Initialize Trello::Client::List.
Constructor Details
#initialize(list) {|_self| ... } ⇒ List
Initialize Trello::Client::List
Params:
list
-
Hash’ified JSON list or JSON string
19 20 21 22 23 |
# File 'lib/trello-client/list.rb', line 19 def initialize(list) @list = list.kind_of?(Hash) ? list : MultiJson.decode(list) yield self if block_given? self end |
Instance Method Details
#[](key) ⇒ Object
Get Trello::Client::List property
28 29 30 |
# File 'lib/trello-client/list.rb', line 28 def[](key) @list[key] end |
#cards ⇒ Object
TODO Get Array
of cards
35 36 37 38 39 40 41 |
# File 'lib/trello-client/list.rb', line 35 def cards #unless @lists # @lists = ( @list['lists'] || [] ).collect { |l| Trello::Client::List.new(l) } #end #@lists @list['cards'] || [] end |