Method: IniFile#each

Defined in:
lib/inifile.rb

#eachObject

Public: Yield each INI file section, parameter, and value in turn to the given block.

block - The block that will be iterated by the each method. The block will

be passed the current section and the parameter / value pair.

Examples

inifile.each do |section, parameter, value|
  puts "#{parameter} = #{value} [in section - #{section}]"
end

Returns this IniFile.



225
226
227
228
229
230
231
232
233
# File 'lib/inifile.rb', line 225

def each
  return unless block_given?
  @ini.each do |section,hash|
    hash.each do |param,val|
      yield section, param, val
    end
  end
  self
end