private Method

XmlSimple.collapse_content(hash)

Tries to collapse a Hash even more ;-)

hash:Hash to be collapsed again.

Source Code

# File active_support/vendor/xml-simple-1.0.11/xmlsimple.rb, line 624
def collapse_content(hash)
  content_key = @options['contentkey']
  hash.each_value { |value|
    return hash unless value.instance_of?(Hash) && value.size == 1 && value.has_key?(content_key)
    hash.each_key { |key| hash[key] = hash[key][content_key] }
  }
  hash
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.