Class: Crefo::Service::Response
- Inherits:
-
Object
- Object
- Crefo::Service::Response
- Defined in:
- lib/crefo/service/response.rb
Direct Known Subclasses
ChangePassword::Response, Keylist::Response, Logon::Response, Crefo::Service::Report::Response, Search::Response
Defined Under Namespace
Classes: ParsingError, ResponseError
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#document_hash ⇒ Object
readonly
Returns the value of attribute document_hash.
Class Method Summary collapse
Instance Method Summary collapse
- #document_body_hash ⇒ Object
- #document_fault_hash ⇒ Object
- #document_reponse_hash ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #response_id ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
9 10 11 12 13 14 15 |
# File 'lib/crefo/service/response.rb', line 9 def initialize(response) @response = response @body = '' @attachments = [] parse_body parse_document end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
7 8 9 |
# File 'lib/crefo/service/response.rb', line 7 def @attachments end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/crefo/service/response.rb', line 7 def body @body end |
#document_hash ⇒ Object (readonly)
Returns the value of attribute document_hash.
7 8 9 |
# File 'lib/crefo/service/response.rb', line 7 def document_hash @document_hash end |
Class Method Details
.response_name ⇒ Object
78 79 80 |
# File 'lib/crefo/service/response.rb', line 78 def response_name @response_name end |
.response_name=(response_name) ⇒ Object
82 83 84 |
# File 'lib/crefo/service/response.rb', line 82 def response_name=(response_name) @response_name = response_name end |
Instance Method Details
#document_body_hash ⇒ Object
17 18 19 |
# File 'lib/crefo/service/response.rb', line 17 def document_body_hash document_reponse_hash[:body] end |
#document_fault_hash ⇒ Object
25 26 27 |
# File 'lib/crefo/service/response.rb', line 25 def document_fault_hash document_hash.dig(:Envelope, :Body, :Fault) end |
#document_reponse_hash ⇒ Object
21 22 23 |
# File 'lib/crefo/service/response.rb', line 21 def document_reponse_hash document_hash[:Envelope][:Body][:"#{self.class.response_name}Response"] end |
#response_id ⇒ Object
29 30 31 |
# File 'lib/crefo/service/response.rb', line 29 def response_id document_reponse_hash[:header][:responseid] end |