Class: Qbot::Adapter::Shell

Inherits:
Driver
  • Object
show all
Defined in:
lib/qbot/adapter/shell.rb

Defined Under Namespace

Modules: Keyboard

Instance Method Summary collapse

Methods inherited from Driver

build, inherited, #run

Instance Method Details

#closeObject



34
35
36
# File 'lib/qbot/adapter/shell.rb', line 34

def close
  EM.stop
end

#listen(&block) ⇒ Object



30
31
32
# File 'lib/qbot/adapter/shell.rb', line 30

def listen(&block)
  EM.run { EM.open_keyboard(Keyboard, block) }
end

#post(text, **options) ⇒ Object



38
39
40
# File 'lib/qbot/adapter/shell.rb', line 38

def post(text, **options)
  $stdout.puts text
end

#reply_to(message, text, **options) ⇒ Object



42
43
44
# File 'lib/qbot/adapter/shell.rb', line 42

def reply_to(message, text, **options)
  post(text, **options)
end