instance method
blank?
Ruby on Rails 4.2.9
Since v2.2.3Signature
blank?()
An object is blank if it’s false, empty, or a whitespace string. For example, false, ”, ‘ ’, nil, [], and {} are all blank.
This simplifies
!address || address.empty?
to
address.blank?
@return [true, false]
Source
# File activesupport/lib/active_support/core_ext/object/blank.rb, line 16
def blank?
respond_to?(:empty?) ? !!empty? : !self
end
Defined in activesupport/lib/active_support/core_ext/object/blank.rb line 16
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Object