Class: WindowBlessing::XtermInput
- Inherits:
-
Object
- Object
- WindowBlessing::XtermInput
- Defined in:
- lib/window_blessing/xterm_input.rb
Instance Attribute Summary collapse
-
#event_parser ⇒ Object
readonly
Returns the value of attribute event_parser.
Instance Method Summary collapse
-
#initialize ⇒ XtermInput
constructor
A new instance of XtermInput.
- #read_events ⇒ Object
Constructor Details
#initialize ⇒ XtermInput
Returns a new instance of XtermInput.
6 7 8 |
# File 'lib/window_blessing/xterm_input.rb', line 6 def initialize @event_parser = XtermEventParser.new end |
Instance Attribute Details
#event_parser ⇒ Object (readonly)
Returns the value of attribute event_parser.
4 5 6 |
# File 'lib/window_blessing/xterm_input.rb', line 4 def event_parser @event_parser end |
Instance Method Details
#read_events ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/window_blessing/xterm_input.rb', line 10 def read_events events = [] if raw = read_pending_input parsed = event_parser.parse(raw) if parsed new_events = parsed.events events += new_events new_events.length else events << {:type => :event_parser_failure, :raw => raw, :failure_info => event_parser.parser_failure_info} end end events end |