def modify(dn, attributes)
      if attributes.kind_of?(Hash)
        attributes = normalize_attributes(attributes)
      else
        attributes = attributes.map do |(action, key, values)|
          [action, Ldaptic.encode(key), values.respond_to?(:before_type_cast) ? values.before_type_cast : [values].flatten.compact]
        end
      end
      log_dispatch(:modify, dn, attributes)
      adapter.modify(dn, attributes) unless attributes.empty?
    end
def modify(dn, attributes)
      if attributes.kind_of?(Hash)
        attributes = normalize_attributes(attributes)
      else
        attributes = attributes.map do |(action, key, values)|
          [action, Ldaptic.encode(key), values.respond_to?(:before_type_cast) ? values.before_type_cast : [values].flatten.compact]
        end
      end
      log_dispatch(:modify, dn, attributes)
      adapter.modify(dn, attributes) unless attributes.empty?
    end
Performs an LDAP modify.