module DatabaseCleaner::Neo4j::Base

Public Instance Methods

database() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 27
def database
  db && default_db.merge(db) || default_db
end
db() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 15
def db
  @db ||= nil
end
db=(desired_db) click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 11
def db=(desired_db)
  @db = desired_db == :default ? nil : desired_db
end
start() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 19
def start
  if db_type == :embedded_db and not session.running?
    session.start
  else
    session
  end
end

Private Instance Methods

db_params() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 53
def db_params
  database.reject!{|key, value| [:type, :path].include? key }
end
db_path() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 49
def db_path
  database[:path]
end
db_type() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 45
def db_type
  database[:type]
end
default_db() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 33
def default_db
  {:type => default_db_type, :path => default_db_path}
end
default_db_path(type = default_db_type) click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 41
def default_db_path(type = default_db_type)
  type == :server_db ? 'http://localhost:7475/' : './db/test'
end
default_db_type() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 37
def default_db_type
  :server_db
end
session() click to toggle source
# File lib/database_cleaner/neo4j/base.rb, line 57
def session
  @session ||= ::Neo4j::Session.open(db_type, db_path, db_params)
end