Class: Linzer::Message::Adapter::Generic::Response
- Defined in:
- lib/linzer/message/adapter/generic/response.rb
Direct Known Subclasses
Instance Method Summary collapse
- #attach!(signature) ⇒ Object
- #header(name) ⇒ Object
-
#initialize(operation, **options) ⇒ Response
constructor
A new instance of Response.
Methods inherited from Abstract
#[], #attached_request?, #field?, #request?, #response?
Constructor Details
#initialize(operation, **options) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 13 14 |
# File 'lib/linzer/message/adapter/generic/response.rb', line 8 def initialize(operation, **) @operation = operation 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
#attach!(signature) ⇒ Object
20 21 22 23 |
# File 'lib/linzer/message/adapter/generic/response.rb', line 20 def attach!(signature) signature.to_h.each { |h, v| @operation[h] = v } @operation end |
#header(name) ⇒ Object
16 17 18 |
# File 'lib/linzer/message/adapter/generic/response.rb', line 16 def header(name) @operation[name] end |