Class: LDAP::Mod
- Inherits:
-
Object
- Object
- LDAP::Mod
- Defined in:
- lib/ldap/ldif.rb
Instance Method Summary collapse
-
#to_ldif(dn) ⇒ Object
(also: #to_s)
Convert an LDAP::Mod with the DN given in
dn
to LDIF.
Instance Method Details
#to_ldif(dn) ⇒ Object Also known as: to_s
Convert an LDAP::Mod with the DN given in dn
to LDIF.
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
# File 'lib/ldap/ldif.rb', line 543 def to_ldif( dn ) ldif = "dn: %s\n" % dn # TODO: Need to dynamically assemble this case statement to add # OpenLDAP's increment change type, etc. case mod_op & ~LDAP_MOD_BVALUES when LDAP_MOD_ADD ldif << "changetype: add\n" when LDAP_MOD_DELETE ldif << "changetype: delete\n" when LDAP_MOD_REPLACE return LDIF.mods_to_ldif( dn, self ) end ldif << LDIF.to_ldif( mod_type, mod_vals ) LDIF::Mod.new( ldif ) end |