Class: ROM::EventStore::Gateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/rom/event_store/gateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Gateway

Returns a new instance of Gateway.



7
8
9
10
# File 'lib/rom/event_store/gateway.rb', line 7

def initialize(uri)
  @connection = Estore::Session.new(*uri.split(':'))
  @categories = {}
end

Instance Method Details

#[](name) ⇒ Object



12
13
14
# File 'lib/rom/event_store/gateway.rb', line 12

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

#dataset(name) ⇒ Object



16
17
18
# File 'lib/rom/event_store/gateway.rb', line 16

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

#dataset?(name) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/rom/event_store/gateway.rb', line 20

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