Exemplo n.º 1
0
static VALUE header_hash_reverse_merge_bang(VALUE self, VALUE other) {
  if (!rb_obj_is_kind_of(other, nyara_header_hash_class)) {
    rb_raise(rb_eArgError, "need a Nyara::HeaderHash");
  }
  st_table* t = rb_hash_tbl(self);
  rb_hash_foreach(other, _reverse_merge_func, (VALUE)t);
  return self;
}
Exemplo n.º 2
0
static int
collect_values_of_values(VALUE category, VALUE category_objects, VALUE categories)
{
    VALUE ary = rb_ary_new();
    st_foreach(rb_hash_tbl(category_objects), collect_values, ary);
    rb_hash_aset(categories, category, ary);
    return ST_CONTINUE;
}