Module: OmniAuth::Slack::CallerMethodName

Included in:
Debug
Defined in:
lib/omniauth-slack/refinements.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(other) ⇒ Object



61
62
63
# File 'lib/omniauth-slack/refinements.rb', line 61

def self.included(other)
  other.send(:extend, CallerMethodName)
end

Instance Method Details

#caller_method_nameObject



56
57
58
59
# File 'lib/omniauth-slack/refinements.rb', line 56

def caller_method_name
  #caller[0][/`([^']*)'/, 1] # This gets the method name only 1 level up.
  caller[1][/`([^']*)'/, 1]  # This gets the method name 2 levels up.
end