Class: Hobostove::InputPanel

Inherits:
Panel
  • Object
show all
Defined in:
lib/hobostove/input_panel.rb

Instance Attribute Summary

Attributes inherited from Panel

#height, #options, #startx, #starty, #width

Instance Method Summary collapse

Methods inherited from Panel

#initialize, #refresh, #refresh!, #scroll_down, #scroll_up, #wrap_lines?

Constructor Details

This class inherits a constructor from Hobostove::Panel

Instance Method Details

#<<(string) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/hobostove/input_panel.rb', line 3

def <<(string)
  @strings = []

  string = string.last(width - 4)

  super(string)
end

#messageObject



11
12
13
# File 'lib/hobostove/input_panel.rb', line 11

def message
  @strings.first.to_s
end

#update_cursorObject



15
16
17
# File 'lib/hobostove/input_panel.rb', line 15

def update_cursor
  Curses.setpos(Curses.lines - 2, message.size + 2)
end