Method: Exception.action_name

Defined in:
lib/merb-core/controller/exceptions.rb

.action_nameObject

Returns the action_name that will be invoked on your Exceptions controller when an instance is raised during a request.

Returns

String

The name of the action in the Exceptions controller which will get invoked

when an instance of this Exception sub/class is raised by an action.

:api: public



33
34
35
36
37
38
39
40
41
# File 'lib/merb-core/controller/exceptions.rb', line 33

def self.action_name
  if self == Exception
    return nil unless Object.const_defined?(:Exceptions) && 
      Exceptions.method_defined?(:exception)
  end
  name = self.to_s.split('::').last.snake_case
  Object.const_defined?(:Exceptions) && 
    Exceptions.method_defined?(name) ? name : superclass.action_name
end