Class: Neo4j::Embedded::EmbeddedDatabase
- Inherits:
-
Object
- Object
- Neo4j::Embedded::EmbeddedDatabase
- Defined in:
- lib/neo4j-embedded/embedded_database.rb
Defined Under Namespace
Classes: Error
Class Method Summary collapse
- .connect(db_location, config = {}) ⇒ Object
- .create_db(db_location) ⇒ Object
- .factory_class ⇒ Object
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_class ⇒ Object
20 21 22 |
# File 'lib/neo4j-embedded/embedded_database.rb', line 20 def factory_class Java::OrgNeo4jTest::ImpermanentGraphDatabase end |