Class: CWG::MonitorKeys
- Inherits:
-
Object
- Object
- CWG::MonitorKeys
- Defined in:
- /Users/martyn/cw/cw_clone/lib/cw/monitor_keys.rb
Instance Method Summary (collapse)
- - (Boolean) empty?
- - (Boolean) have_data?
-
- (MonitorKeys) initialize(cw)
constructor
A new instance of MonitorKeys.
- - (Object) key_input
- - (Object) monitor_keys
Constructor Details
- (MonitorKeys) initialize(cw)
Returns a new instance of MonitorKeys
9 10 11 12 13 |
# File '/Users/martyn/cw/cw_clone/lib/cw/monitor_keys.rb', line 9 def initialize(cw) @cw = cw @key_input = KeyInput.new @queue = Queue.new end |
Instance Method Details
- (Boolean) empty?
19 20 21 |
# File '/Users/martyn/cw/cw_clone/lib/cw/monitor_keys.rb', line 19 def empty? @queue.empty? end |
- (Boolean) have_data?
23 24 25 |
# File '/Users/martyn/cw/cw_clone/lib/cw/monitor_keys.rb', line 23 def have_data? ! empty? end |
- (Object) key_input
15 16 17 |
# File '/Users/martyn/cw/cw_clone/lib/cw/monitor_keys.rb', line 15 def key_input @key_input ||= KeyInput.new end |
- (Object) monitor_keys
27 28 29 30 31 32 33 34 35 36 37 38 |
# File '/Users/martyn/cw/cw_clone/lib/cw/monitor_keys.rb', line 27 def monitor_keys loop do get_key_input break if check_quit_key_input if @cw.quit key_input.reset break end key_chr if self.class == Book build_word_maybe end end |