Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/www/delicious.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?
Object#blank? comes from the GEM ActiveSupport 2.1.
940 941 942 |
# File 'lib/www/delicious.rb', line 940 def blank? respond_to?(:empty?) ? empty? : !self end |