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

#on_message(&block) ⇒ Object



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

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

#post(text, **options) ⇒ Object



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

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

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



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

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