Class: ROM::Neo4j::Gateway

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, options = {}) ⇒ Gateway

Returns a new instance of Gateway.



8
9
10
11
# File 'lib/rom/neo4j/gateway.rb', line 8

def initialize(uri, options={})
  @connection = ::Neo4j::Session.open(:server_db, uri, options)
  @sets = {}
end

Instance Attribute Details

#setsObject (readonly)

Returns the value of attribute sets.



6
7
8
# File 'lib/rom/neo4j/gateway.rb', line 6

def sets
  @sets
end

Instance Method Details

#dataset(name) ⇒ Object



13
14
15
# File 'lib/rom/neo4j/gateway.rb', line 13

def dataset(name)
  sets[name] = Dataset.new(@connection.query)
end

#dataset?(name) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rom/neo4j/gateway.rb', line 17

def dataset?(name)
  sets.key?(name)
end