module ActiveLdap::Operations::LDIF

def dump(options={})

def dump(options={})
  ldif = Ldif.new
  options = {:base => base, :scope => scope}.merge(options)
  options[:connection] ||= connection
  options[:connection].search(options) do |dn, attributes|
    ldif << Ldif::Record.new(dn, attributes)
  end
  return "" if ldif.records.empty?
  ldif.to_s
end

def load(ldif, options={})

def load(ldif, options={})
  return if ldif.blank?
  Ldif.parse(ldif).each do |record|
    record.load(self, options)
  end
end

def to_ldif(dn, attributes)

def to_ldif(dn, attributes)
  Ldif.new([to_ldif_record(dn, attributes)]).to_s
end

def to_ldif_record(dn, attributes)

def to_ldif_record(dn, attributes)
  Ldif::Record.new(dn, attributes)
end