Sha256: 0b3345bc93a8bf94d2cf4907a8bca5d02ac179a2c2f96f51ec4552f5949ed6f4

Contents?: true

Size: 454 Bytes

Versions: 9

Compression:

Stored size: 454 Bytes

Contents

require "socrates/adapters/console"
require "socrates/core/dispatcher"

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
socrates-0.1.16 lib/socrates/bots/cli.rb
socrates-0.1.15 lib/socrates/bots/cli.rb
socrates-0.1.14 lib/socrates/bots/cli.rb
socrates-0.1.13 lib/socrates/bots/cli.rb
socrates-0.1.12 lib/socrates/bots/cli.rb
socrates-0.1.11 lib/socrates/bots/cli.rb
socrates-0.1.10 lib/socrates/bots/cli.rb
socrates-0.1.9 lib/socrates/bots/cli.rb
socrates-0.1.8 lib/socrates/bots/cli.rb