Feature #6646

Objectified caller

Added by Thomas Sawyer about 3 years ago. Updated about 3 years ago.

[ruby-core:45852]
Status:Closed
Priority:Normal
Assignee:-

Description

In Feature #3917 it is mentioned short-coming of caller:

  • caller() returns an array of "filename:linenum in `method'" string. User must parse it and retrieve filename and linenum by rexp. It is also very heavy weight task.

I think many have wished for objectified trace.

caller[0].file
caller[0].line
caller[0].in

Different method would be needed than #caller though to prevent backward compatibility issue.

History

#1 Updated by Koichi Sasada about 3 years ago

is not enough?

loc = caller_locations[0]
loc#label # #in
loc#lineno # #line
loc#path # #file

#2 Updated by Thomas Sawyer about 3 years ago

Yep! And Yeah!

#3 Updated by Yukihiro Matsumoto about 3 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF