Class: Honcho::UI::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/honcho/ui_runner/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headings:, width:, top:, left:) ⇒ Table

Returns a new instance of Table.



6
7
8
9
10
11
# File 'lib/honcho/ui_runner/table.rb', line 6

def initialize(headings:, width:, top:, left:)
  @headings = headings
  @width = width
  @top = top
  @left = left
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



14
15
16
# File 'lib/honcho/ui_runner/table.rb', line 14

def columns
  @columns
end

#headingsObject

Returns the value of attribute headings.



13
14
15
# File 'lib/honcho/ui_runner/table.rb', line 13

def headings
  @headings
end

#leftObject

Returns the value of attribute left.



13
14
15
# File 'lib/honcho/ui_runner/table.rb', line 13

def left
  @left
end

#topObject

Returns the value of attribute top.



13
14
15
# File 'lib/honcho/ui_runner/table.rb', line 13

def top
  @top
end

#widthObject

Returns the value of attribute width.



13
14
15
# File 'lib/honcho/ui_runner/table.rb', line 13

def width
  @width
end

Instance Method Details

#draw(data) ⇒ Object



16
17
18
19
20
# File 'lib/honcho/ui_runner/table.rb', line 16

def draw(data)
  draw_headings
  draw_data(data)
  Curses.refresh
end