|
|
|
|
|
by mcobrien
5335 days ago
|
|
I'm not sure I like it, but this works def nil.method_missing(*args, &block); end
So now you can call nil.whatever.you.like and get nil. It's also still falsy, but now every nil value in your app silently works and doesn't throw an error.It's both impressive and scary that Ruby lets you (or that new contractor you're not sure about) change the fundamentals of the language in one line of code. |
|
https://github.com/raganwald/homoiconic/blob/master/2009-02-...