Class: NilClass
Overview
Instance Method Summary collapse
-
#blank? ⇒ Boolean
nilis considered blank by definition; if#blank?is called onnil, it will always returntrue: nil.blank? # => true. -
#present? ⇒ Boolean
Likewise,
nilis not present by definition; if#present?is called onnil, it will always returnfalse: nil.present? # => false.
Instance Method Details
#blank? ⇒ Boolean
nil is considered blank by definition; if #blank? is called on nil, it will always return true:
nil.blank? # => true
# When the +foo+ variable is undefined or set to nil:
foo.blank? # => true
124 125 126 |
# File 'lib/reactive_support/core_ext/object/blank.rb', line 124 def blank? true end |
#present? ⇒ Boolean
Likewise, nil is not present by definition; if #present? is called on nil, it will always return false:
nil.present? # => false
# When the +foo+ variable is undefined or set to nil:
foo.present? # => false
135 136 137 |
# File 'lib/reactive_support/core_ext/object/blank.rb', line 135 def present? false end |