You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
599 B
33 lines
599 B
module DsAdmin::Storage
|
|
include Enumerable
|
|
|
|
DsAdmin::Storage.autoload(:Config, 'storage/config')
|
|
DsAdmin::Storage.autoload(:Ldap, 'storage/ldap')
|
|
DsAdmin::Storage.autoload(:Mysql, 'storage/mysql')
|
|
|
|
attr_reader :config
|
|
|
|
def initialize(config)
|
|
@config = config
|
|
end
|
|
|
|
def each(&block)
|
|
read.each(&block)
|
|
end
|
|
|
|
def read
|
|
raise "#{self.class}: read not implemented"
|
|
end
|
|
|
|
##
|
|
# write has to return the storage id of the written
|
|
# entry.
|
|
#
|
|
def write(model)
|
|
raise "#{self.class}: write not implemented"
|
|
end
|
|
|
|
def config_key
|
|
self.class.to_s.to_sym
|
|
end
|
|
end
|