Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
ENV.keys
ENV.keys → array of names
hash.c
View on GitHub ↗
static VALUE
env_f_keys(VALUE _)
{
return env_keys(FALSE);
}
Returns all variable names in an Array:
Example
ENV.replace('foo' => '0', 'bar' => '1') ENV.keys # => ['bar', 'foo']
The order of the names is OS-dependent. See About Ordering.