Class: Belajar::Views::TopBar

Inherits:
Object
  • Object
show all
Includes:
Curses
Defined in:
lib/belajar/views/top_bar.rb

Constant Summary collapse

HEIGHT =
4

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(window, text = '') ⇒ TopBar

Returns a new instance of TopBar.



10
11
12
13
14
# File 'lib/belajar/views/top_bar.rb', line 10

def initialize(window, text = '')
  @height = HEIGHT
  @width  = window.maxx
  @panel  = create_panel(window, @width, @height, text)
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



8
9
10
# File 'lib/belajar/views/top_bar.rb', line 8

def height
  @height
end

#panelObject (readonly)

Returns the value of attribute panel.



8
9
10
# File 'lib/belajar/views/top_bar.rb', line 8

def panel
  @panel
end

#widthObject (readonly)

Returns the value of attribute width.



8
9
10
# File 'lib/belajar/views/top_bar.rb', line 8

def width
  @width
end

Instance Method Details

#showObject



16
17
18
# File 'lib/belajar/views/top_bar.rb', line 16

def show
  @panel.refresh
end