Class: Cliptic::Interface::Top_Bar

Inherits:
Windows::Bar show all
Defined in:
lib/cliptic/interface.rb

Direct Known Subclasses

Main::Windows::Top_Bar

Constant Summary

Constants included from Chars

Chars::Block, Chars::HL, Chars::LL, Chars::LS, Chars::LU, Chars::MS, Chars::Nums, Chars::RL, Chars::RS, Chars::RU, Chars::TD, Chars::TL, Chars::TR, Chars::TU, Chars::Tick, Chars::VL, Chars::XX

Instance Attribute Summary collapse

Attributes inherited from Windows::Bar

#bg_col

Attributes inherited from Windows::Window

#centered_x, #centered_y, #col, #line, #x, #y

Instance Method Summary collapse

Methods inherited from Windows::Bar

#add_str, #time_str

Methods inherited from Windows::Window

#add_str, #bold, #clear, #color, #move, #refresh, #reset_attrs, #setpos, #standend, #standout, #time_str, #wrap_str

Methods included from Chars

small_num

Constructor Details

#initialize(date: Date.today) ⇒ Top_Bar

Returns a new instance of Top_Bar.



5
6
7
8
# File 'lib/cliptic/interface.rb', line 5

def initialize(date:Date.today)
  super(line:0)
  @date = date
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



4
5
6
# File 'lib/cliptic/interface.rb', line 4

def date
  @date
end

Instance Method Details

#drawObject



9
10
11
12
13
# File 'lib/cliptic/interface.rb', line 9

def draw
  super
  add_str(x:1, str:title, bold:true)
  add_str(x:title.length+2, str:date.to_long)
end

#reset_posObject



17
18
19
# File 'lib/cliptic/interface.rb', line 17

def reset_pos
  move(line:0, col:0)
end

#titleObject



14
15
16
# File 'lib/cliptic/interface.rb', line 14

def title
  "cliptic:"
end