singleton method ENV.each

each -> Enumerator[permalink][rdoc][edit]
each_pair -> Enumerator
each {|key, value| ... } -> self
each_pair {|key, value| ... } -> self

key と value を引数としてブロックを評価します。


ENV['FOO'] = 'bar'
ENV.each do |key, value|
  p "value is #{value}" if key == 'FOO' # => "value is bar"
end
# => ENV