Class: Termplot::DSL::Panel

Inherits:
Object
  • Object
show all
Includes:
Commands, WidgetDSL
Defined in:
lib/termplot/dsl/panels.rb

Direct Known Subclasses

Col, Row

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WidgetDSL

#histogram, #statistics, #timeseries

Methods included from Commands

#cpu, #memory, #random

Constructor Details

#initialize(options, children = []) ⇒ Panel

Returns a new instance of Panel.



17
18
19
20
# File 'lib/termplot/dsl/panels.rb', line 17

def initialize(options, children = [])
  @options = options
  @children = children
end

Instance Attribute Details

#colsObject

Returns the value of attribute cols.



10
11
12
# File 'lib/termplot/dsl/panels.rb', line 10

def cols
  @cols
end

#rowsObject

Returns the value of attribute rows.



10
11
12
# File 'lib/termplot/dsl/panels.rb', line 10

def rows
  @rows
end

#start_colObject

Returns the value of attribute start_col.



10
11
12
# File 'lib/termplot/dsl/panels.rb', line 10

def start_col
  @start_col
end

#start_rowObject

Returns the value of attribute start_row.



10
11
12
# File 'lib/termplot/dsl/panels.rb', line 10

def start_row
  @start_row
end

Instance Method Details

#flattenObject



26
27
28
# File 'lib/termplot/dsl/panels.rb', line 26

def flatten
  children.map(&:flatten).flatten
end

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



22
23
24
# File 'lib/termplot/dsl/panels.rb', line 22

def set_dimensions(rows, cols, start_row, start_col)
  raise "Must be implemented"
end