3 ms·
Except in Ruby, that error is raised by `NilClass#method_missing`. `method_missing` gets to know the name of the method being called, and the arguments passed t
by adrusi 12y ago
Except in Ruby, that error is raised by `NilClass#method_missing`. `method_missing` gets to know the name of the method being called, and the arguments passed to it, but it deals with the value, not the variable. It wouldn't be "trivial" to report the name of the variable, it would probably involve intercepting all NoMethodErrors raised by NilClass and then dropping into the debugger to know where exactly execution stopped. I'm not sure this is even possible with the current architecture of the Ruby interpreter.
- nilved 12y agohttp://ruby-doc.org//core-1.8.7/Kernel.html#method-i-caller http://ruby-doc.org//core-1.8.7/Kernel.html#method-i-caller https://github.com/banister/method_source https://github.com/banister/method_source