Sha256: ebf23a71931befe1c71a647c53265b0509d3389ecdca011ce5448bee2f241c1a

Contents?: true

Size: 397 Bytes

Versions: 1

Compression:

Stored size: 397 Bytes

Contents

module Socrates
  module Bots
    class CLIBot
      def initialize(adapter:, state_factory:)
        @adapter    = adapter || Adapters::ConsoleAdapter.new
        @dispatcher = Core::Dispatcher.new(adapter: @adapter, state_factory: state_factory)
      end

      def start
        while (input = gets.chomp)
          @dispatcher.dispatch(message: input)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
socrates-0.1.2 lib/socrates/bots/cli_bot.rb