Class: Hooks::Plugins::Lifecycle

Inherits:
Object
  • Object
show all
Includes:
Core::ComponentAccess
Defined in:
lib/hooks/plugins/lifecycle.rb

Overview

Base class for global lifecycle plugins

Plugins can hook into request/response/error lifecycle events

Instance Method Summary collapse

Methods included from Core::ComponentAccess

#failbot, #log, #method_missing, #respond_to_missing?, #stats

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Hooks::Core::ComponentAccess

Instance Method Details

#on_error(exception, env) ⇒ Object

Called when any error occurs during request processing

Parameters:

  • exception (Exception)

    The raised exception

  • env (Hash)

    Rack environment



33
34
35
# File 'lib/hooks/plugins/lifecycle.rb', line 33

def on_error(exception, env)
  # Override in subclass for error handling logic
end

#on_request(env) ⇒ Object

Called before handler execution

Parameters:

  • env (Hash)

    Rack environment



17
18
19
# File 'lib/hooks/plugins/lifecycle.rb', line 17

def on_request(env)
  # Override in subclass for pre-processing logic
end

#on_response(env, response) ⇒ Object

Called after successful handler execution

Parameters:

  • env (Hash)

    Rack environment

  • response (Hash)

    Handler response



25
26
27
# File 'lib/hooks/plugins/lifecycle.rb', line 25

def on_response(env, response)
  # Override in subclass for post-processing logic
end