class Meshchat::Ui::CLI::Base

this class, and all subclasses are Keyboard Handlers that are used for EventMachine's open_keyboard @see github.com/eventmachine/eventmachine/wiki/Code-Snippets#keyboard-input-example

Attributes

_input_buffer[R]

An array of typed keystrokes

_input_receiver[R]

The class used for interpeting the line input

Public Class Methods

new(input_receiver) click to toggle source
# File lib/meshchat/ui/cli/base.rb, line 14
def initialize(input_receiver)
  @_input_receiver = input_receiver
  @_input_buffer = []
end

Public Instance Methods

receive_data(data) click to toggle source

override this method to alter how input is interpreted by the receiver.

hopefully, just by calling a different method on the receiver, as input processing shouldn't occurr in this class or any subclass unless it is raw keystroke input

@note that this method receives raw keystrokes by default

and does not send data to the input receiver
# File lib/meshchat/ui/cli/base.rb, line 29
def receive_data(data)
  _input_buffer.push(data)
end
receive_line(line) click to toggle source
# File lib/meshchat/ui/cli/base.rb, line 33
def receive_line(line)
  # only used when including EM::Protocols::LineText2
end