Exception: Xero::Errors::BadRequest
- Inherits:
-
StandardError
- Object
- StandardError
- Xero::Errors::BadRequest
- Defined in:
- lib/xero/errors/bad_request.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#request_xml ⇒ Object
readonly
Returns the value of attribute request_xml.
-
#response_xml ⇒ Object
readonly
Returns the value of attribute response_xml.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(request_xml, response_xml) ⇒ BadRequest
constructor
A new instance of BadRequest.
Constructor Details
#initialize(request_xml, response_xml) ⇒ BadRequest
Returns a new instance of BadRequest.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/xero/errors/bad_request.rb', line 7 def initialize(request_xml, response_xml) @request_xml = request_xml @response_xml = response_xml Hash.from_xml(response_xml).tap do |data| @type = data['ApiException']['Type'] @message = data['ApiException']['Message'] @error_number = data['ApiException']['ErrorNumber'] end self end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/xero/errors/bad_request.rb', line 5 def @message end |
#request_xml ⇒ Object (readonly)
Returns the value of attribute request_xml.
5 6 7 |
# File 'lib/xero/errors/bad_request.rb', line 5 def request_xml @request_xml end |
#response_xml ⇒ Object (readonly)
Returns the value of attribute response_xml.
5 6 7 |
# File 'lib/xero/errors/bad_request.rb', line 5 def response_xml @response_xml end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/xero/errors/bad_request.rb', line 5 def type @type end |