class method · added in Ruby 3.4
Warning.categories
() -> ::Array[::Symbol]
categories → array
error.c
View on GitHub ↗
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);
}
Returns a list of the supported category symbols.
Ruby version changes
-
3.4
-
Add
Warning.categoriesmethod which returns a list of possible warning categories. [Feature #20293]
-