Sha256: 0b25c7d86167e2c9cbd93d5d21dbd90951edaf191c8e5c74705239d521842acd

Contents?: true

Size: 470 Bytes

Versions: 2

Compression:

Stored size: 470 Bytes

Contents

require 'estore'
require 'rom/event_store/dataset'

module ROM
  module EventStore
    class Gateway < ROM::Gateway
      def initialize(uri)
        @connection = Estore::Session.new(*uri.split(':'))
        @categories = {}
      end

      def [](name)
        @categories[name]
      end

      def dataset(name)
        @categories[name] = Dataset.new(name, connection)
      end

      def dataset?(name)
        @categories.key?(name)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rom-event_store-0.0.7 lib/rom/event_store/gateway.rb
rom-event_store-0.0.6 lib/rom/event_store/gateway.rb