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 CLI/STDIN
Instance Method Summary collapse
-
#initialize ⇒ CommandInterface
constructor
A new instance of CommandInterface.
- #start ⇒ Object
Constructor Details
#initialize ⇒ CommandInterface
Returns a new instance of CommandInterface.
4 5 6 |
# File 'lib/lemmibot/command_interface.rb', line 4 def initialize @bot = Lemmibot::Bot.new end |
Instance Method Details
#start ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lemmibot/command_interface.rb', line 8 def start 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 end end end |