Exception: Payfort::PayfortError
- Inherits:
-
StandardError
- Object
- StandardError
- Payfort::PayfortError
- Defined in:
- lib/payfort/errors/payfort_error.rb
Direct Known Subclasses
AuthenticationError, BankingError, ProcessingError, RequestError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(message = nil, code = nil, http_status = nil) ⇒ PayfortError
constructor
A new instance of PayfortError.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, code = nil, http_status = nil) ⇒ PayfortError
Returns a new instance of PayfortError.
7 8 9 10 11 |
# File 'lib/payfort/errors/payfort_error.rb', line 7 def initialize(=nil, code=nil, http_status=nil) @message = @code = code @http_status = http_status end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/payfort/errors/payfort_error.rb', line 4 def code @code end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
5 6 7 |
# File 'lib/payfort/errors/payfort_error.rb', line 5 def http_status @http_status end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/payfort/errors/payfort_error.rb', line 3 def @message end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 |
# File 'lib/payfort/errors/payfort_error.rb', line 13 def to_s status_string = @http_status.nil? ? "" : "(#{@code}Error - Status #{@http_status}) " "#{status_string}#{@message}" end |