Class: Linzer::Message::Adapter::Generic::Request
- Defined in:
- lib/linzer/message/adapter/generic/request.rb
Overview
Generic HTTP request adapter.
Provides a base implementation for request message access. Assumes the operation responds to [] for header access and has a uri attribute.
Direct Known Subclasses
Instance Method Summary collapse
-
#attach!(signature) ⇒ Object
Attaches a signature to the request.
-
#header(name) ⇒ String?
Retrieves a header value by name.
-
#initialize(operation, **options) ⇒ Request
constructor
Creates a new request adapter.
Methods inherited from Abstract
#[], #attached_request?, #field?, #request?, #response?
Constructor Details
#initialize(operation, **options) ⇒ Request
Creates a new request adapter.
31 32 33 34 |
# File 'lib/linzer/message/adapter/generic/request.rb', line 31 def initialize(operation, **) @operation = operation freeze end |
Instance Method Details
#attach!(signature) ⇒ Object
Attaches a signature to the request.
46 47 48 49 |
# File 'lib/linzer/message/adapter/generic/request.rb', line 46 def attach!(signature) signature.to_h.each { |h, v| @operation[h] = v } @operation end |
#header(name) ⇒ String?
Retrieves a header value by name.
39 40 41 |
# File 'lib/linzer/message/adapter/generic/request.rb', line 39 def header(name) @operation[name] end |