Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

ENV.inspect

ENV.inspect → a_string

Returns the contents of the environment as a String:

Example
ENV.replace('foo' => '0', 'bar' => '1')
ENV.inspect # => "{\"bar\"=>\"1\", \"foo\"=>\"0\"}"
See also .include? .invert .has_value? .keep_if also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0