Class: Linzer::Message::Adapter::Rack::Response
- Includes:
- Common
- Defined in:
- lib/linzer/message/adapter/rack/response.rb
Overview
Adapter for Rack::Response objects.
Instance Method Summary collapse
-
#header(name) ⇒ String?
Retrieves a header value by name.
-
#initialize(operation, **options) ⇒ Response
constructor
Creates a new Rack response adapter.
Methods inherited from Abstract
#[], #attach!, #attached_request?, #field?, #has_signature?, #request?, #response?
Constructor Details
#initialize(operation, **options) ⇒ Response
Creates a new Rack response adapter.
15 16 17 18 19 20 21 22 |
# File 'lib/linzer/message/adapter/rack/response.rb', line 15 def initialize(operation, **) @operation = operation validate attached_request = [:attached_request] @attached_request = attached_request ? Message.new(attached_request) : nil validate_attached_request @attached_request if @attached_request freeze end |
Instance Method Details
#header(name) ⇒ String?
Retrieves a header value by name.
27 28 29 |
# File 'lib/linzer/message/adapter/rack/response.rb', line 27 def header(name) @operation.get_header(name) end |