示例#1
0
文件: hashes.c 项目: fsword/nyara
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;
}
示例#2
0
文件: objspace.c 项目: knugie/ruby
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;
}