Browse files

revises comment for blank? method

  • Loading branch information...
1 parent 5e23527 commit 162bf8ffb1bef8729f22e2adfae7b1a5d096173d @vijaydev vijaydev committed May 7, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 activesupport/lib/active_support/core_ext/object/blank.rb
View
6 activesupport/lib/active_support/core_ext/object/blank.rb
@@ -1,14 +1,14 @@
class Object
# An object is blank if it's false, empty, or a whitespace string.
- # For example, "", " ", +nil+, [], and {} are blank.
+ # For example, "", " ", +nil+, [], and {} are all blank.
#
# This simplifies:
#
- # if !address.nil? && !address.empty?
+ # if address.nil? || address.empty?
#
# ...to:
#
- # if !address.blank?
+ # if address.blank?
def blank?
respond_to?(:empty?) ? empty? : !self
end

0 comments on commit 162bf8f

Please sign in to comment.