Class: LDAP::Mod

### Home Classes Methods

### In Files

- lib/ldap/ldif.rb

### Parent

Object

### Methods

- #to_ldif
- #to_s

### Class/Module Index

Quicksearch

- LDAP
- LDAP::Conn
- LDAP::Control
- LDAP::Entry
- LDAP::LDIF
- LDAP::LDIF::Entry
- LDAP::LDIF::LDIFError
- LDAP::LDIF::Mod
- LDAP::Mod
- LDAP::Record
- LDAP::Schema

No matching classes.

# LDAP::Mod

### Public Instance Methods

to_ldif( dn ) click to toggle source

Convert an LDAP::Mod with the DN given in `dn` to LDIF.

    # 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

Also aliased as: to_s
to_s( dn ) click to toggle source
Alias for: to_ldif

[Validate]

Generated with the Darkfish Rdoc Generator 2.