class NilClass
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/active_support/core_ext/object/blank.rbs class NilClass def as_json: (?Hash? options) -> nil def blank?: () -> true end
def as_json(options = nil) # :nodoc:
Experimental RBS support (using type sampling data from the type_fusion
project).
def as_json: (?[]? options) -> nil
This signature was generated using 14 samples from 1 application.
def as_json(options = nil) # :nodoc: self end
def blank?
Experimental RBS support (using type sampling data from the type_fusion
project).
def blank?: () -> true
This signature was generated using 224 samples from 3 applications.
-
(true)
-
def blank? true end
def to_param
def to_param self end
def try(*)
With +try+
@person && @person.children.any? && @person.children.first.name
Without +try+
nil.try(:name) # => nil
It becomes especially helpful when navigating through associations that may return +nil+.
Calling +try+ on +nil+ always returns +nil+.
def try(*) nil end
def try!(*)
Calling +try!+ on +nil+ always returns +nil+.
def try!(*) nil end