Class: Cards::RowLayout
Instance Method Summary collapse
Instance Method Details
#height(card) ⇒ Object
17 18 19 |
# File 'lib/cards/layouts/row_layout.rb', line 17 def height(card) card.children.map {|c| c.height}.max end |
#layout(card) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/cards/layouts/row_layout.rb', line 3 def layout(card) x = card.x card.children.each_with_index do |child, i| child.x = x child.y = card.y + 1 child.layout x += child.width end end |
#width(card) ⇒ Object
13 14 15 |
# File 'lib/cards/layouts/row_layout.rb', line 13 def width(card) card.children.map {|c| c.width}.sum end |