Method: Warning.categories
- Defined in:
- error.c
.categories ⇒ Array
Returns a list of the supported category symbols.
262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'error.c', line 262
static VALUE
rb_warning_s_categories(VALUE mod)
{
st_index_t num = warning_categories.id2enum->num_entries;
ID *ids = ALLOCA_N(ID, num);
num = st_keys(warning_categories.id2enum, ids, num);
VALUE ary = rb_ary_new_capa(num);
for (st_index_t i = 0; i < num; ++i) {
rb_ary_push(ary, ID2SYM(ids[i]));
}
return rb_ary_freeze(ary);
}
|