Class: Hooks::App::RackEnvBuilder
- Inherits:
-
Object
- Object
- Hooks::App::RackEnvBuilder
- Defined in:
- lib/hooks/app/rack_env_builder.rb
Overview
Builds Rack environment hash for lifecycle hooks and handler processing
This class centralizes the construction of the Rack environment that gets passed to lifecycle hooks and handlers, ensuring consistency and making it easy to reference the environment structure.
Instance Method Summary collapse
-
#build ⇒ Hash
Build the Rack environment hash.
-
#initialize(request, headers, request_context, endpoint_config, start_time, full_path) ⇒ RackEnvBuilder
constructor
Initialize the builder with required components.
Constructor Details
#initialize(request, headers, request_context, endpoint_config, start_time, full_path) ⇒ RackEnvBuilder
Initialize the builder with required components
26 27 28 29 30 31 32 33 |
# File 'lib/hooks/app/rack_env_builder.rb', line 26 def initialize(request, headers, request_context, endpoint_config, start_time, full_path) @request = request @headers = headers @request_context = request_context @endpoint_config = endpoint_config @start_time = start_time @full_path = full_path end |
Instance Method Details
#build ⇒ Hash
Build the Rack environment hash
Constructs a hash containing standard Rack environment variables plus Hooks-specific extensions for lifecycle hooks and handlers.
41 42 43 44 45 |
# File 'lib/hooks/app/rack_env_builder.rb', line 41 def build rack_env = build_base_environment add_http_headers(rack_env) rack_env end |