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.
37 lines
721 B
37 lines
721 B
module DsAdmin::Storage
|
|
include Enumerable
|
|
|
|
DsAdmin::Storage.autoload(:Ldap, 'storage/ldap')
|
|
DsAdmin::Storage.autoload(:Mysql, 'storage/mysql')
|
|
DsAdmin::Storage.autoload(:Config, 'storage/config')
|
|
|
|
attr_accessor :config
|
|
|
|
def initialize(config)
|
|
@config = config
|
|
end
|
|
|
|
def each(&block)
|
|
read.each(&block)
|
|
end
|
|
|
|
##
|
|
# We don't need this....the 'id' is a storage id and as
|
|
# thus returned after successfully writing a new entry.
|
|
#
|
|
def create_id(model)
|
|
return "dummy id for #{model.inspect}"
|
|
end
|
|
|
|
def read
|
|
throw "#{self.class}: read not implemented"
|
|
end
|
|
|
|
def write(model)
|
|
throw "#{self.class}: write not implemented"
|
|
end
|
|
|
|
def to_sym
|
|
self.class.to_s.to_sym
|
|
end
|
|
end
|