Class: Daneel::Adapters::Shell
- Inherits:
-
Daneel::Adapter
- Object
- Plugin
- Daneel::Adapter
- Daneel::Adapters::Shell
- Defined in:
- lib/daneel/adapters/shell.rb
Instance Attribute Summary
Attributes inherited from Plugin
Instance Method Summary collapse
- #announce(*strings) ⇒ Object
-
#initialize(robot) ⇒ Shell
constructor
A new instance of Shell.
- #run ⇒ Object
- #say(id, *strings) ⇒ Object
Methods inherited from Daneel::Adapter
Methods inherited from Plugin
Constructor Details
Instance Method Details
#announce(*strings) ⇒ Object
29 30 31 32 |
# File 'lib/daneel/adapters/shell.rb', line 29 def announce(*strings) puts say @room.id, *strings end |
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/daneel/adapters/shell.rb', line 14 def run # End the line we were on when we exit trap(:EXIT){ print "\n" } while text = Readline.readline("> ", true) next if text.empty? = Message.new(text, Time.now, "text") robot.receive @room, , @user end end |
#say(id, *strings) ⇒ Object
25 26 27 |
# File 'lib/daneel/adapters/shell.rb', line 25 def say(id, *strings) puts *strings end |