some_obj.big.long.chain.of.methods.that.breaks.because.of.a.nil
# => Exception, nil or the result of the last method call
!some_obj.big.nil? && !some_obj.big.long.nil? && !some_obj.big.long.chain.nil? && !some_obj.big.long.chain.of.nil? #.....................
# => lame
nil.forgive { some_obj.big.long.chain.of.methods.that.breaks.because.of.a.nil }
# => nil, or the result of the last method call
-
Notifications
You must be signed in to change notification settings - Fork 0
finbarr/forgiving_nil
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published