Class: As2::Client::Result
- Inherits:
-
Object
- Object
- As2::Client::Result
- Defined in:
- lib/as2/client/result.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#disposition ⇒ Object
readonly
Returns the value of attribute disposition.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#mic_matched ⇒ Object
readonly
Returns the value of attribute mic_matched.
-
#mid_matched ⇒ Object
readonly
Returns the value of attribute mid_matched.
-
#outbound_message_id ⇒ Object
readonly
Returns the value of attribute outbound_message_id.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#signature_verification_error ⇒ Object
readonly
Returns the value of attribute signature_verification_error.
Instance Method Summary collapse
-
#disp_code ⇒ Object
legacy name.
-
#initialize(request:, response:, mic_matched:, mid_matched:, body:, disposition:, signature_verification_error:, exception:, outbound_message_id:) ⇒ Result
constructor
A new instance of Result.
- #signature_verified ⇒ Object
- #success ⇒ Object
Constructor Details
#initialize(request:, response:, mic_matched:, mid_matched:, body:, disposition:, signature_verification_error:, exception:, outbound_message_id:) ⇒ Result
Returns a new instance of Result.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/as2/client/result.rb', line 6 def initialize(request:, response:, mic_matched:, mid_matched:, body:, disposition:, signature_verification_error:, exception:, outbound_message_id:) @request = request @response = response @mic_matched = mic_matched @mid_matched = mid_matched @body = body @disposition = disposition @signature_verification_error = signature_verification_error @exception = exception @outbound_message_id = end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def body @body end |
#disposition ⇒ Object (readonly)
Returns the value of attribute disposition.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def disposition @disposition end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def exception @exception end |
#mic_matched ⇒ Object (readonly)
Returns the value of attribute mic_matched.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def mic_matched @mic_matched end |
#mid_matched ⇒ Object (readonly)
Returns the value of attribute mid_matched.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def mid_matched @mid_matched end |
#outbound_message_id ⇒ Object (readonly)
Returns the value of attribute outbound_message_id.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def @outbound_message_id end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def response @response end |
#signature_verification_error ⇒ Object (readonly)
Returns the value of attribute signature_verification_error.
4 5 6 |
# File 'lib/as2/client/result.rb', line 4 def signature_verification_error @signature_verification_error end |
Instance Method Details
#disp_code ⇒ Object
legacy name. accessor for backwards-compatibility.
23 24 25 |
# File 'lib/as2/client/result.rb', line 23 def disp_code self.disposition end |
#signature_verified ⇒ Object
18 19 20 |
# File 'lib/as2/client/result.rb', line 18 def signature_verified self.signature_verification_error.nil? end |
#success ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/as2/client/result.rb', line 27 def success # 'processed' is good (though may include warnings.) # 'processed/error' is not. downcased_disposition = self.disposition.to_s.downcase # TODO: we'll never have success if MDN is unsigned. self.signature_verified && self.mic_matched && self.mid_matched && downcased_disposition.include?('processed') && !downcased_disposition.include?('processed/error') end |