Method: IniFile#match

Defined in:
lib/inifile.rb

#match(regex) ⇒ Object

Public: Create a Hash containing only those INI file sections whose names match the given regular expression.

regex - The Regexp used to match section names.

Examples

inifile.match(/^tree_/)
#=> Hash of matching sections

Return a Hash containing only those sections that match the given regular expression.



310
311
312
# File 'lib/inifile.rb', line 310

def match( regex )
  @ini.dup.delete_if { |section, _| section !~ regex }
end