naught
naught copied to clipboard
Null-aware Proxies
Wrap myvalue
and intercept each method call, wrapping the return value. If ANY call returns nil, replace it with a null object:
SomeConversionFunc(myvalue).foo.bar.baz # => <null>
Counterpoint: without Demeter violations this wouldn't be needed ;-)