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
13
14
# File 'lib/neo4j-embedded/embedded_database.rb', line 8

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

.create_db(db_location) ⇒ Object



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

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



22
23
24
# File 'lib/neo4j-embedded/embedded_database.rb', line 22

def factory_class
  Java::OrgNeo4jTest::ImpermanentGraphDatabase
end