Class: Hut::Window
- Inherits:
-
Object
- Object
- Hut::Window
- Defined in:
- lib/hut/window.rb
Instance Method Summary collapse
-
#initialize(hut) ⇒ Window
constructor
A new instance of Window.
- #new_message(body) ⇒ Object
- #room=(room) ⇒ Object
- #room_was_updated(room) ⇒ Object
- #update ⇒ Object
Constructor Details
Instance Method Details
#new_message(body) ⇒ Object
33 34 35 |
# File 'lib/hut/window.rb', line 33 def (body) @room. body end |
#room=(room) ⇒ Object
12 13 14 15 |
# File 'lib/hut/window.rb', line 12 def room=(room) @room = room update end |
#room_was_updated(room) ⇒ Object
27 28 29 30 31 |
# File 'lib/hut/window.rb', line 27 def room_was_updated(room) if room == @room update end end |
#update ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/hut/window.rb', line 17 def update clear print_header @room.(@lines - 4).each do |msg| @out.print "#{msg.formatted_for_print}\n" end @out.flush end |