Class: Linzer::Message::Adapter::Rack::Request
- 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
-
#attach!(signature) ⇒ ::Rack::Request
Attaches a signature to the request.
-
#header(name) ⇒ String?
Retrieves a header value by name.
-
#initialize(operation, **options) ⇒ Request
constructor
Creates a new Rack request adapter.
Methods inherited from Abstract
#[], #attached_request?, #field?, #request?, #response?
Constructor Details
#initialize(operation, **options) ⇒ Request
Creates a new Rack request adapter.
17 18 19 20 21 |
# File 'lib/linzer/message/adapter/rack/request.rb', line 17 def initialize(operation, **) @operation = operation validate freeze end |
Instance Method Details
#attach!(signature) ⇒ ::Rack::Request
Attaches a signature to the request.
33 34 35 36 37 38 |
# File 'lib/linzer/message/adapter/rack/request.rb', line 33 def attach!(signature) signature.to_h.each do |h, v| @operation.set_header(rack_header_name(h), v) end @operation end |
#header(name) ⇒ String?
Retrieves a header value by name.
26 27 28 |
# File 'lib/linzer/message/adapter/rack/request.rb', line 26 def header(name) @operation.get_header(rack_header_name(name)) end |