Method: Object#blank?

Defined in:
lib/flow/core_ext/blank.rb

#blank?true, false

activesupport/lib/active_support/core_ext/object/blank.rb An object is blank if it’s false, empty, or a whitespace string. For example, ”, ‘ ’, nil, [], and {} are all blank.

This simplifies

address.nil? || address.empty?

to

address.blank?

Returns:

  • (true, false)


17
18
19
# File 'lib/flow/core_ext/blank.rb', line 17

def blank?
  respond_to?(:empty?) ? !!empty? : !self
end