Method: IniFile#dup
- Defined in:
- lib/inifile.rb
#dup ⇒ Object
Public: Produces a duplicate of this IniFile. The duplicate is independent of the original – i.e. the duplicate can be modified without changing the original. The tainted state of the original is copied to the duplicate.
Returns a new IniFile.
360 361 362 363 364 365 366 |
# File 'lib/inifile.rb', line 360 def dup other = super other.instance_variable_set(:@ini, Hash.new {|h,k| h[k] = Hash.new}) @ini.each_pair {|s,h| other[s].merge! h} other.taint if self.tainted? other end |