Method: Kernel#calling_method

Defined in:
lib/cosmos/core_ext/kernel.rb

#calling_method(start = 1) ⇒ Symbol

Returns The name of the calling method.

Parameters:

  • start (Integer) (defaults to: 1)

    The number of stack entries to skip

Returns:

  • (Symbol)

    The name of the calling method



39
40
41
# File 'lib/cosmos/core_ext/kernel.rb', line 39

def calling_method(start = 1)
  caller[start][/`([^']*)'/, 1].intern
end