Class: SsciInc::Response
- Inherits:
-
Object
- Object
- SsciInc::Response
- Defined in:
- lib/ssci_inc/response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#date_order_received ⇒ Object
readonly
postback.
-
#error_code ⇒ Object
readonly
ErrorReport.
-
#error_description ⇒ Object
readonly
ErrorReport.
-
#order_id ⇒ Object
readonly
postback.
-
#order_status ⇒ Object
readonly
postback.
-
#reference_id ⇒ Object
readonly
postback.
-
#result_status ⇒ Object
readonly
postback.
-
#result_url ⇒ Object
readonly
postback.
-
#screening_status ⇒ Object
readonly
postback.
Instance Method Summary collapse
-
#initialize(data) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(data) ⇒ Response
Returns a new instance of Response.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ssci_inc/response.rb', line 13 def initialize(data) @data = data document = Nokogiri::XML.parse(data) # errors @error_code = document.at("//ErrorCode").try(:text) @error_description = document.at("//ErrorDescription").try(:text) # completed postback response @screening_results_type = document.at("//BackgroundReportPackage//@type").try(:text) @order_status = document.at("//OrderStatus").try(:text) @result_status = document.at("//ResultStatus").try(:text) @date_order_received = document.at("//DateOrderReceived").try(:text) @result_url = document.at("//InternetWebAddress//CDATA").try(:text) @result_url = document.at("//InternetWebAddress").try(:text) unless @result_url @order_id = document.at("//Receipt").try(:text) @reference_id = document.at("//ExtraIdentifier").try(:text) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/ssci_inc/response.rb', line 4 def data @data end |
#date_order_received ⇒ Object (readonly)
postback
10 11 12 |
# File 'lib/ssci_inc/response.rb', line 10 def date_order_received @date_order_received end |
#error_code ⇒ Object (readonly)
ErrorReport
7 8 9 |
# File 'lib/ssci_inc/response.rb', line 7 def error_code @error_code end |
#error_description ⇒ Object (readonly)
ErrorReport
7 8 9 |
# File 'lib/ssci_inc/response.rb', line 7 def error_description @error_description end |
#order_id ⇒ Object (readonly)
postback
10 11 12 |
# File 'lib/ssci_inc/response.rb', line 10 def order_id @order_id end |
#order_status ⇒ Object (readonly)
postback
10 11 12 |
# File 'lib/ssci_inc/response.rb', line 10 def order_status @order_status end |
#reference_id ⇒ Object (readonly)
postback
10 11 12 |
# File 'lib/ssci_inc/response.rb', line 10 def reference_id @reference_id end |
#result_status ⇒ Object (readonly)
postback
10 11 12 |
# File 'lib/ssci_inc/response.rb', line 10 def result_status @result_status end |
#result_url ⇒ Object (readonly)
postback
10 11 12 |
# File 'lib/ssci_inc/response.rb', line 10 def result_url @result_url end |
#screening_status ⇒ Object (readonly)
postback
10 11 12 |
# File 'lib/ssci_inc/response.rb', line 10 def screening_status @screening_status end |