index

# ENV

  The object that represents environment variables. It has almost equivalent interfaces to the Hash objects, except the keys and values of ENV must be strings.

## Included Modules:

  `Enumerable`

## Methods:

  `self [key]`

    Returns the value of the environment variable specified by the key. Returns `nil`, if no such environment variable exists.

  `self [key]= value`

    Changes or sets the value of the environment variable specified by the key to the value. If the value is `nil`, the environment variable will be removed.

  `delete(key)`

    Deletes the environment variable. Returns nil if the variable specified by the key does not exist. In case the block is supplied to this method, it will be evaluated when no environment variable exists.

  `delete_if {|key, value|...}`
  `reject!{|key, value|...}`

    Deletes environment variables, if the evaluated value of the block with the array of `[key,value]` as an argument is true.

  `each {|key, value|...}`
  `each_pair {|key, value|...}`

    Iterates over each pair of keys and values (`[key,value]`) of the environment variables.

  `each_key {|key|...}`

    Iterates over each name of all environment variables.

  `each_value {|value|...}`

    Iterates over each value of all environment variables.

  `empty?`

    Returns true if no environment variable defined.

  `has_key?(val)`
  `key?(val)`
  `include?(val)`

    Returns true if there is the environment variable named val.

  `has_value?(value)`
  `value?(value)`

    Returns true, if there exists any environment variable which has the value.

  `indexes(key_1,..., key_n)`

    Returns an array of values of environment variables that names are specified by arguments.

  `keys`

    Returns an array of all environment variables.

  `length`
  `size`

    Returns the number of environment variables.

  `to_a`

    Returns an array of two element arrays of the environment variables which is `[name,value]`.

  `values`

    Returns an array of the values of all environment variables.

index

matz@netlab.co.jp