/*
 * call-seq:
 * LDAP.hash2mods(mod_type, hash)  => Array of LDAP::Mod
 *
 * Convert a hash into an array of LDAP::Mod objects. +mod_type+ should
 * contain the mod type, which is most commonly *LDAP_MOD_ADD*,
 * *LDAP_MOD_REPLACE* or *LDAP_MOD_DELETE*, although some LDAP servers may
 * offer extension types.
 */
VALUE
rb_ldap_hash2mods (VALUE self, VALUE op, VALUE hash)
{
  VALUE tmp;

  tmp = rb_assoc_new (op, rb_ary_new ());
  rb_iterate (rb_each, hash, rb_ldap_hash2mods_i, tmp);

  return rb_ary_entry (tmp, 1);
}