Class: EgonGate::Kobra::Response
- Inherits:
-
Object
- Object
- EgonGate::Kobra::Response
- Defined in:
- lib/egon_gate/kobra/response.rb
Instance Method Summary collapse
- #egsb_response ⇒ Object
- #error? ⇒ Boolean
- #error_message ⇒ Object
-
#initialize(soap_response) ⇒ Response
constructor
A new instance of Response.
- #pure_xml ⇒ Object
Constructor Details
#initialize(soap_response) ⇒ Response
Returns a new instance of Response.
7 8 9 10 |
# File 'lib/egon_gate/kobra/response.rb', line 7 def initialize(soap_response) @soap_response = soap_response @egsb_string = soap_response.body[:get_data_response][:get_data_result] end |
Instance Method Details
#egsb_response ⇒ Object
16 17 18 |
# File 'lib/egon_gate/kobra/response.rb', line 16 def egsb_response @response ||= nori.parse( Base64.decode64 pure_xml[:gate_message][:body] ) end |
#error? ⇒ Boolean
20 21 22 |
# File 'lib/egon_gate/kobra/response.rb', line 20 def error? egsb_response.values.first[:odpoved_info][:status][:vysledek_kod] != "OK" end |
#error_message ⇒ Object
24 25 26 |
# File 'lib/egon_gate/kobra/response.rb', line 24 def egsb_response.values.first[:odpoved_info][:status][:vysledek_detail][:vysledek_sub_kod] end |
#pure_xml ⇒ Object
12 13 14 |
# File 'lib/egon_gate/kobra/response.rb', line 12 def pure_xml @responsed_body ||= nori.parse(@egsb_string) end |