Class: Amun::UI::EchoArea

Inherits:
Object
  • Object
show all
Defined in:
lib/amun/ui/echo_area.rb

Overview

a line that is rendered by default at the end on the screen takes one line height and extends to take the whole width of screen should be linked to *messages* memory buffer and display new messages in the buffer text

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEchoArea

Returns a new instance of EchoArea.



16
17
18
# File 'lib/amun/ui/echo_area.rb', line 16

def initialize
  @last_messages_size = 0
end

Instance Attribute Details

#eventsObject



12
13
14
# File 'lib/amun/ui/echo_area.rb', line 12

def events
  @events ||= EventManager.new
end

Instance Method Details

#render(window) ⇒ Object

render the echo area window



25
26
27
28
29
# File 'lib/amun/ui/echo_area.rb', line 25

def render(window)
  window.clear
  window << message
  update_last_messages_size
end

#trigger(event) ⇒ Object



20
21
22
# File 'lib/amun/ui/echo_area.rb', line 20

def trigger(event)
  EventManager.join(event, events)
end