Project

General

Profile

Actions

Feature #16001

open

Provide an alias to Kernel#caller_locations(1,1) and Kernel#caller(1,1)

Added by piotrmurach (Piotr Murach) over 5 years ago. Updated about 5 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:93753]

Description

As it is common to use caller_locations(1,1) and caller(1,1), this proposes aliases to help get the previous backtrace frame and improve performance by avoiding getting full backtrace information - a common mistake.

The currently suggestions are:

  • immediate_caller
  • first_caller
  • caller_only

This feature request is based on a conversation with Charles Nutter who says:

This is such a common thing... maybe we need to add something like #caller_only or #caller1 that basically do caller(1,1).

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0