Skip to content

finbarr/forgiving_nil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages