private Method

XmlSimple.empty(value)

Checks, if an object is nil, an empty String or an empty Hash. Thanks to Norbert Gawor for a bugfix.

value:Value to be checked for emptyness.

Source Code

# File active_support/vendor/xml-simple-1.0.11/xmlsimple.rb, line 911
def empty(value)
  case value
    when Hash
      return value.empty?
    when String
      return value !~ /\S/m
    else
      return value.nil?
  end
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.