Class: FullscreenTui::Footer
- Inherits:
-
Object
- Object
- FullscreenTui::Footer
- Defined in:
- lib/fullscreen_tui/footer.rb
Constant Summary collapse
- SEPERATOR =
' | '
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize ⇒ Footer
constructor
A new instance of Footer.
- #output(width:, lines:, current_line:) ⇒ Object
Constructor Details
#initialize ⇒ Footer
Returns a new instance of Footer.
8 9 10 |
# File 'lib/fullscreen_tui/footer.rb', line 8 def initialize self. = '' end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/fullscreen_tui/footer.rb', line 5 def @message end |
Instance Method Details
#output(width:, lines:, current_line:) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fullscreen_tui/footer.rb', line 12 def output width:, lines:, current_line: parts = [ , "#{(current_line + 1).to_s.rjust lines.to_s.size}/#{lines}", ] part_width = width - parts[1].size - SEPERATOR.size parts[0] = if parts[0].size > part_width "#{parts[0][0...part_width - 3]}..." else parts[0].ljust part_width end parts.join SEPERATOR end |