Class: Lemmibot::CommandInterface
- Inherits:
-
Object
- Object
- Lemmibot::CommandInterface
- Defined in:
- lib/lemmibot/command_interface.rb
Overview
An interface for issuing commands to a Lemmibot via interactive command-line or piped in scripts
Instance Method Summary collapse
-
#initialize ⇒ CommandInterface
constructor
A new instance of CommandInterface.
- #start ⇒ Object
Constructor Details
#initialize ⇒ CommandInterface
Returns a new instance of CommandInterface.
5 6 7 |
# File 'lib/lemmibot/command_interface.rb', line 5 def initialize @bot = Lemmibot::Bot.new end |
Instance Method Details
#start ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/lemmibot/command_interface.rb', line 9 def start # Start a session, receiving and processing commands from standard input puts 'Lemmibot is awaiting your commands' loop do command = gets return unless command begin process_command(command.chomp) rescue # Malformed and failed commands should be ignored, so take no action end end end |