Class: Daigaku::Views::TopBar

Inherits:
Object
  • Object
show all
Includes:
Curses
Defined in:
lib/daigaku/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.



11
12
13
14
15
# File 'lib/daigaku/views/top_bar.rb', line 11

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.



9
10
11
# File 'lib/daigaku/views/top_bar.rb', line 9

def height
  @height
end

#panelObject (readonly)

Returns the value of attribute panel.



9
10
11
# File 'lib/daigaku/views/top_bar.rb', line 9

def panel
  @panel
end

#widthObject (readonly)

Returns the value of attribute width.



9
10
11
# File 'lib/daigaku/views/top_bar.rb', line 9

def width
  @width
end

Instance Method Details

#showObject



17
18
19
# File 'lib/daigaku/views/top_bar.rb', line 17

def show
  @panel.refresh
end