class Blinkman::Adapter::Shell

Constants

PROMPT

Attributes

stopped[R]

Public Class Methods

new(bot) click to toggle source
Calls superclass method Blinkman::Adapter::Base::new
# File lib/blinkman/adapter/shell.rb, line 10
def initialize(bot)
  @stopped = false
  super
end

Public Instance Methods

listen() click to toggle source
# File lib/blinkman/adapter/shell.rb, line 15
def listen
  while ! stopped
    bot.on_receive(read)
  end
end
read() click to toggle source
# File lib/blinkman/adapter/shell.rb, line 21
def read
  Message::Shell.new(
    Readline.readline(PROMPT, true).tap do |line|
      @stopped = (line == 'exit')
    end
  )
end