instance method
empty
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.2.3 PrivateSignature
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 emptiness.
Parameters
-
valuereq
Source
# File activesupport/lib/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
Defined in activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb line 911
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in XmlSimple