Class: LDAP::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/ldap/ldif.rb

Instance Method Summary collapse

Instance Method Details

#to_ldifObject Also known as: to_s

Convert an LDAP::Entry to LDIF.



523
524
525
526
527
528
529
530
531
532
533
# File 'lib/ldap/ldif.rb', line 523

def to_ldif
  ldif = "dn: %s\n" % get_dn

  get_attributes.each do |attr|
    get_values( attr ).each do |val|
      ldif << LDIF.to_ldif( attr, [ val ] )
    end
  end

  LDIF::Entry.new( ldif )
end