to_h

ENV.to_hash â hashENV.to_h â hash Class Public methods Creates a hash with a copy of the environment variables.

to_a

ENV.to_a â Array Class Public methods Converts the environment variables into an array of names and value arrays. ENV.to_a # => [["TERM", "xterm-color"], ["SHELL", "/bin/bash"], ...]

store

ENV.store(name, value) â value Class Public methods Sets the environment variable name to value. If the value given is nil the environment variable is deleted.

size

ENV.size Class Public methods Returns the number of environment variables.

shift

ENV.shift â Array or nil Class Public methods Removes an environment variable name-value pair from ENV and returns it as an Array. Returns nil if when the environment is empty.

select!

ENV.select! { |name, value| } â ENV or nilENV.select! â Enumerator Class Public methods Equivalent to ENV#keep_if but returns nil if no changes were made.

select

ENV.select { |name, value| } â HashENV.select â Enumerator Class Public methods Returns a copy of the environment for entries where the block returns true. Returns an Enumerator if no block was given.

replace

ENV.replace(hash) â env Class Public methods Replaces the contents of the environment variables with the contents of hash.

reject!

ENV.reject! { |name, value| } â ENV or nilENV.reject! â Enumerator Class Public methods Equivalent to ENV#delete_if but returns nil if no changes were made. Returns an Enumerator if no block was given.

reject

ENV.reject { |name, value| } â HashENV.reject â Enumerator Class Public methods Same as ENV#delete_if, but works on (and returns) a copy of the environment.