Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/orange-core/magick.rb
Instance Method Summary collapse
-
#blank? ⇒ Boolean
An object is blank if it’s false, empty, or a whitespace string.
Instance Method Details
#blank? ⇒ Boolean
An object is blank if it’s false, empty, or a whitespace string. For example, “”, “ ”, nil
, [], and {} are blank.
This simplifies
if !address.nil? && !address.empty?
to
if !address.blank?
233 234 235 |
# File 'lib/orange-core/magick.rb', line 233 def blank? respond_to?(:empty?) ? empty? : !self end |