all_symbols()
public
Returns an array of all the symbols currently in Ruby’s symbol table.
Symbol.all_symbols.size
Symbol.all_symbols[1,20]
:chown, :EOFError, :$;, :String,
:LOCK_SH, :"setuid?", :$<,
:default_proc, :compact, :extend,
:Tms, :getwd, :$=, :ThreadGroup,
:wait2, :$>]
Show source
/*
* call-seq:
* Symbol.all_symbols => array
*
* Returns an array of all the symbols currently in Ruby's symbol
* table.
*
* Symbol.all_symbols.size #=> 903
* Symbol.all_symbols[1,20] #=> [:floor, :ARGV, :Binding, :symlink,
* :chown, :EOFError, :$;, :String,
* :LOCK_SH, :"setuid?", :$<,
* :default_proc, :compact, :extend,
* :Tms, :getwd, :$=, :ThreadGroup,
* :wait2, :$>]
*/
VALUE
rb_sym_all_symbols()
{
VALUE ary = rb_ary_new2(sym_tbl->num_entries);
st_foreach(sym_tbl, symbols_i, ary);
return ary;
}