Skip to content
class method

ENV.to_hash

ENV.to_hash → hash of name/value pairs

Returns a Hash containing all name/value pairs from ENV:

Example
ENV.replace('foo' => '0', 'bar' => '1')
ENV.to_hash # => {"bar"=>"1", "foo"=>"0"}
See also .to_h .to_s .to_a .update also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0