Class: Zgomot::UI::TableRowWindow
- Includes:
- Utils
- Defined in:
- lib/zgomot/ui/windows.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#value_color ⇒ Object
readonly
Returns the value of attribute value_color.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
-
#widths ⇒ Object
readonly
Returns the value of attribute widths.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Instance Method Summary collapse
- #display(values, value_color) ⇒ Object
-
#initialize(values, widths, color, top, value_color = COLOR_BORDER) ⇒ TableRowWindow
constructor
A new instance of TableRowWindow.
Methods included from Utils
Constructor Details
#initialize(values, widths, color, top, value_color = COLOR_BORDER) ⇒ TableRowWindow
Returns a new instance of TableRowWindow.
371 372 373 374 375 376 377 378 379 380 |
# File 'lib/zgomot/ui/windows.rb', line 371 def initialize(values, widths, color, top, value_color = COLOR_BORDER) left = 0 @columns = (0..widths.length-1).reduce([]) do|rs, i| width = widths[i] value = values.nil? ? '' : values[i] win = TableCellWindow.new(value, color, width, top, left, value_color) left += width rs << win end end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
370 371 372 |
# File 'lib/zgomot/ui/windows.rb', line 370 def color @color end |
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
370 371 372 |
# File 'lib/zgomot/ui/windows.rb', line 370 def columns @columns end |
#value_color ⇒ Object (readonly)
Returns the value of attribute value_color.
370 371 372 |
# File 'lib/zgomot/ui/windows.rb', line 370 def value_color @value_color end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
370 371 372 |
# File 'lib/zgomot/ui/windows.rb', line 370 def values @values end |
#widths ⇒ Object (readonly)
Returns the value of attribute widths.
370 371 372 |
# File 'lib/zgomot/ui/windows.rb', line 370 def widths @widths end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
370 371 372 |
# File 'lib/zgomot/ui/windows.rb', line 370 def window @window end |
Instance Method Details
#display(values, value_color) ⇒ Object
381 382 383 384 385 |
# File 'lib/zgomot/ui/windows.rb', line 381 def display(values, value_color) (0..columns.length-1).each do |i| columns[i].display(values[i], value_color) end end |