class NilClass

Ruby’s core NilClass (the singleton class consisting of the nil object). See documentation for version 2.1.5, 2.0.0, or 1.9.3.

Public Instance Methods

blank?() click to toggle source

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
    # File lib/reactive_support/core_ext/object/blank.rb
129 def blank?
130   true
131 end
present?() click to toggle source

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
    # File lib/reactive_support/core_ext/object/blank.rb
140 def present?
141   false
142 end