private Method

XmlSimple.force_array?(key)

Checks, if the ‘forcearray’ option has to be used for a certain key.

Source Code

# File active_support/vendor/xml-simple-1.0.11/xmlsimple.rb, line 689
def force_array?(key)
  return false if key == @options['contentkey']
  return true if @options['forcearray'] == true
  forcearray = @options['forcearray']
  if forcearray.instance_of?(Hash)
    return true if forcearray.has_key?(key) 
    return false unless forcearray.has_key?('_regex')
    forcearray['_regex'].each { |x| return true if key =~ x }
  end
  return false
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.