class Charty::ArrayLayout
Public Class Methods
new(direction=:horizontal)
click to toggle source
# File lib/charty/layout.rb, line 38 def initialize(direction=:horizontal) @array = [] @direction = direction end
Public Instance Methods
<<(content)
click to toggle source
# File lib/charty/layout.rb, line 43 def <<(content) @array << content end
num_cols()
click to toggle source
# File lib/charty/layout.rb, line 51 def num_cols @direction == :vertical ? 1 : @array.count end
num_rows()
click to toggle source
# File lib/charty/layout.rb, line 47 def num_rows @direction == :horizontal ? 1 : @array.count end
rows()
click to toggle source
# File lib/charty/layout.rb, line 55 def rows [@array] end