Class: Linzer::Message::Adapter::Rack::Request

Inherits:
Abstract
  • Object
show all
Includes:
Common
Defined in:
lib/linzer/message/adapter/rack/request.rb

Overview

Adapter for Rack::Request objects.

Handles the Rack-specific header naming conventions (HTTP_* prefix, uppercase, underscores).

Instance Method Summary collapse

Methods inherited from Abstract

#[], #attach!, #attached_request?, #field?, #has_signature?, #request?, #response?

Constructor Details

#initialize(operation, **options) ⇒ Request

Creates a new Rack request adapter.

Parameters:

  • operation (::Rack::Request)

    The Rack request

  • options (Hash)

    Additional options (unused)



17
18
19
20
21
# File 'lib/linzer/message/adapter/rack/request.rb', line 17

def initialize(operation, **options)
  @operation = operation
  validate
  freeze
end

Instance Method Details

#header(name) ⇒ String?

Retrieves a header value by name.

Parameters:

  • name (String)

    The header name (e.g., “content-type”)

Returns:

  • (String, nil)

    The header value



26
27
28
# File 'lib/linzer/message/adapter/rack/request.rb', line 26

def header(name)
  @operation.get_header(rack_header_name(name))
end