Class: Uh::Layout::Arrangers::VertTile

Inherits:
Object
  • Object
show all
Defined in:
lib/uh/layout/arrangers/vert_tile.rb

Instance Method Summary collapse

Constructor Details

#initialize(entries, geo) ⇒ VertTile

Returns a new instance of VertTile.



5
6
7
8
# File 'lib/uh/layout/arrangers/vert_tile.rb', line 5

def initialize entries, geo
  @entries  = entries
  @geo      = geo
end

Instance Method Details

#arrangeObject



10
11
12
13
14
15
16
17
# File 'lib/uh/layout/arrangers/vert_tile.rb', line 10

def arrange
  entry_height = @geo.height / @entries.size - 1
  @entries.each_with_index do |entry, i|
    entry.geo     = @geo.dup
    entry.y       = (entry_height + 1) * i
    entry.height  = entry_height
  end
end

#each_hiddenObject



23
24
# File 'lib/uh/layout/arrangers/vert_tile.rb', line 23

def each_hidden
end

#each_visibleObject



19
20
21
# File 'lib/uh/layout/arrangers/vert_tile.rb', line 19

def each_visible
  @entries.each { |e| yield e }
end