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