Class: Rodbot::Simulator
- Inherits:
-
Object
- Object
- Rodbot::Simulator
- Defined in:
- lib/rodbot/simulator.rb
Overview
Simulate a chat client
Instance Method Summary collapse
-
#initialize(sender, raw: false) ⇒ Simulator
constructor
A new instance of Simulator.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/rodbot/simulator.rb', line 23 def run puts nil, "Talking to app on #{Rodbot::Services::App.url} as sender #{@pastel.inverse(@sender)}." puts 'Type commands beginning with "!" or empty line to exit.', nil while (line = Readline.readline("rodbot> ", true)) && !line.empty? puts nil, reply_to(line), nil end puts end |