lib/neoid.rb in neoid-0.0.1 vs lib/neoid.rb in neoid-0.0.2
- old
+ new
@@ -1,19 +1,23 @@
require "neoid/version"
require "neoid/model_config"
require "neoid/model_additions"
require "neoid/node"
require "neoid/relationship"
-require "neoid/railtie" if defined? Rails
module Neoid
class << self
attr_accessor :db
+ attr_accessor :logger
attr_accessor :ref_node
def db
- raise "Neoid.db wasn't supplied" unless @db
+ raise "Must set Neoid.db with a Neography::Rest instance" unless @db
@db
+ end
+
+ def logger
+ @logger ||= Logger.new(ENV['NEOID_LOG'] ? $stdout : '/dev/null')
end
def ref_node
@ref_node ||= Neography::Node.load(Neoid.db.get_root['self'])
end