2015-07-16 17:18:55 +03:00
|
|
|
require "exceptions/record_not_found"
|
|
|
|
|
require "exceptions/invalid_record"
|
2015-02-12 13:01:05 +03:00
|
|
|
require "exceptions/invalid_command"
|
|
|
|
|
require "exceptions/invalid_privileges"
|
|
|
|
|
|
|
|
|
|
module Connectors
|
|
|
|
|
class Base
|
|
|
|
|
# Yes, we can implement connectors without attr_accessor, storing collection directly
|
|
|
|
|
# in instance variable like
|
|
|
|
|
# @collection = db.collection('users')
|
|
|
|
|
#
|
|
|
|
|
# But with latter approach included modules should know about instance variables of
|
|
|
|
|
# base classes.
|
|
|
|
|
# Also, debugging "No method error" is simplier than seeking missing instance var.
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
attr_accessor :collection
|
|
|
|
|
end
|
|
|
|
|
end
|