Class: Termplot::DSL::Row

Inherits:
Panel
  • Object
show all
Defined in:
lib/termplot/dsl/panels.rb

Instance Attribute Summary

Attributes inherited from Panel

#cols, #rows, #start_col, #start_row

Instance Method Summary collapse

Methods inherited from Panel

#flatten, #initialize

Methods included from WidgetDSL

#histogram, #statistics, #timeseries

Methods included from Commands

#cpu, #memory, #random

Constructor Details

This class inherits a constructor from Termplot::DSL::Panel

Instance Method Details

#set_dimensions(rows, cols, start_row, start_col) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/termplot/dsl/panels.rb', line 47

def set_dimensions(rows, cols, start_row, start_col)
  @rows = rows
  @cols = cols
  child_cols = cols / children.count

  children.each_with_index do |child, index|
    child.set_dimensions(
      rows,
      child_cols,
      start_row,
      child_cols * index
    )
  end
end