private Method

XmlSimple.fold_arrays(hash)

Folds all arrays in a Hash.

hash:Hash to be folded.

Source Code

# File active_support/vendor/xml-simple-1.0.11/xmlsimple.rb, line 544
def fold_arrays(hash)
  fold_amount = 0
  keyattr = @options['keyattr']
  if (keyattr.instance_of?(Array) || keyattr.instance_of?(Hash))
    hash.each { |key, value|
      if value.instance_of?(Array)
        if keyattr.instance_of?(Array)
          hash[key] = fold_array(value)
        else
          hash[key] = fold_array_by_name(key, value)
        end
        fold_amount += 1
      end
    }
  end
  fold_amount
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.