Module: Yello::FromTrello

Defined in:
lib/yello/from_trello.rb

Class Method Summary collapse

Class Method Details

.cards(array) ⇒ Object



20
21
22
23
24
25
# File 'lib/yello/from_trello.rb', line 20

def cards(array)
  # Sort by position
  array.sort_by{|c|c.pos}.map{|c|
    Yello::Card.new(c.name, c.desc, checklists(c.checklists))
  } 
end

.checklists(array) ⇒ Object



27
28
29
30
31
# File 'lib/yello/from_trello.rb', line 27

def checklists(array)
  array.map{|cl|
    Yello::Checklist.new(cl.name, cl.items.map(&:name))
  }
end

.convert(board) ⇒ Object



14
15
16
17
18
# File 'lib/yello/from_trello.rb', line 14

def convert(board)
  board.lists.map{|l|
    Yello::List.new(l.name, cards(l.cards))   
  }
end