instance method
blank?
Ruby on Rails 7.0.10
Since v2.2.3Signature
blank?()
An object is blank if it’s false, empty, or a whitespace string. For example, nil, ”, ‘ ’, [], {}, and false 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 18
def blank?
respond_to?(:empty?) ? !!empty? : !self
end
Defined in activesupport/lib/active_support/core_ext/object/blank.rb line 18
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Object