instance method fold_arrays

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.2.3 Private

Signature

fold_arrays(hash)

Folds all arrays in a Hash.

hash

Hash to be folded.

Parameters

hash req
Source
# File activesupport/lib/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

Defined in activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb line 544 · View on GitHub · Improve this page · Find usages on GitHub

Defined in XmlSimple

Type at least 2 characters to search.

↑↓ navigate · open · esc close