Exception: OpenpayException
- Inherits:
-
StandardError
- Object
- StandardError
- OpenpayException
- Defined in:
- lib/openpay/errors/openpay_exception.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#http_body ⇒ Object
readonly
Returns the value of attribute http_body.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
-
#json_body ⇒ Object
readonly
Returns the value of attribute json_body.
Instance Method Summary collapse
-
#initialize(message = nil, json_message = true) ⇒ OpenpayException
constructor
A new instance of OpenpayException.
Constructor Details
#initialize(message = nil, json_message = true) ⇒ OpenpayException
Returns a new instance of OpenpayException.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/openpay/errors/openpay_exception.rb', line 10 def initialize(=nil,=true) #openpay errors have a json error string if json= JSON.parse @description = json['description'] @http_code = json['http_code'] @error_code = json['error_code'] @json_body = @category = json['category'] #other errors may or not have a json error string, so this case is for them else @description = @http_code = '' @http_body = '' @json_body = '' @error_code = '' end end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
8 9 10 |
# File 'lib/openpay/errors/openpay_exception.rb', line 8 def category @category end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/openpay/errors/openpay_exception.rb', line 3 def description @description end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
7 8 9 |
# File 'lib/openpay/errors/openpay_exception.rb', line 7 def error_code @error_code end |
#http_body ⇒ Object (readonly)
Returns the value of attribute http_body.
5 6 7 |
# File 'lib/openpay/errors/openpay_exception.rb', line 5 def http_body @http_body end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
4 5 6 |
# File 'lib/openpay/errors/openpay_exception.rb', line 4 def http_code @http_code end |
#json_body ⇒ Object (readonly)
Returns the value of attribute json_body.
6 7 8 |
# File 'lib/openpay/errors/openpay_exception.rb', line 6 def json_body @json_body end |