20 lines
		
	
	
		
			606 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
		
		
			
		
	
	
			20 lines
		
	
	
		
			606 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
|   | require "db/exceptions/record_not_found" | ||
|  | require "db/exceptions/invalid_record" | ||
|  | 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 |