Class: PayXML::Error
Overview
Wraps an error message from the API.
Constant Summary
Constants inherited from Message
Message::PAYXML_VERSION_NUMBER
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Attributes inherited from Message
#paygate_id, #paygate_password
Instance Method Summary collapse
Methods inherited from Message
Constructor Details
This class inherits a constructor from PayXML::Message
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/payxml/error.rb', line 6 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/payxml/error.rb', line 7 def description @description end |
Instance Method Details
#parse(xml_string) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/payxml/error.rb', line 9 def parse(xml_string) super(xml_string) doc = Nokogiri::XML(xml_string) errorrx = doc.xpath("//errorrx").first @code = errorrx['ecode'] @description = errorrx['edesc'] end |