Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
ENV.to_hash
ENV.to_hash → hash of name/value pairs
hash.c
View on GitHub ↗
static VALUE
env_f_to_hash(VALUE _)
{
return env_to_hash();
}
Returns a Hash containing all name/value pairs from ENV:
Example
ENV.replace('foo' => '0', 'bar' => '1') ENV.to_hash # => {"bar"=>"1", "foo"=>"0"}