Class: Neo4j::Embedded::EmbeddedDatabase

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j-embedded/embedded_database.rb

Defined Under Namespace

Classes: Error

Class Method Summary collapse

Class Method Details

.connect(db_location, config = {}) ⇒ Object



8
9
10
11
12
# File 'lib/neo4j-embedded/embedded_database.rb', line 8

def connect(db_location, config = {})
  return Neo4j::Session.current if Neo4j::Session.current.respond_to?(:db_location) && Neo4j::Session.current.db_location == db_location

  EmbeddedSession.new(db_location, config)
end

.create_db(db_location) ⇒ Object



14
15
16
17
18
# File 'lib/neo4j-embedded/embedded_database.rb', line 14

def create_db(db_location)
  puts "Start embedded Neo4j db at #{db_location}"
  factory = Java::OrgNeo4jGraphdbFactory::GraphDatabaseFactory.new
  factory.newEmbeddedDatabase(db_location)
end

.factory_classObject



20
21
22
# File 'lib/neo4j-embedded/embedded_database.rb', line 20

def factory_class
  Java::OrgNeo4jTest::ImpermanentGraphDatabase
end