Exception: YourMembership::Error
- Inherits:
-
StandardError
- Object
- StandardError
- YourMembership::Error
- Defined in:
- lib/your_membership/error.rb
Overview
Custom exception for YourMembership error codes.
Instance Attribute Summary collapse
-
#error_code ⇒ Integer
The Error Code.
-
#error_description ⇒ String
A Description of what the error means.
Instance Method Summary collapse
-
#initialize(error_code, error_description) ⇒ Error
constructor
A new instance of Error.
-
#to_s ⇒ String
A highly readable error message.
Constructor Details
#initialize(error_code, error_description) ⇒ Error
Returns a new instance of Error.
11 12 13 14 |
# File 'lib/your_membership/error.rb', line 11 def initialize(error_code, error_description) self.error_code = error_code self.error_description = error_description end |
Instance Attribute Details
#error_code ⇒ Integer
The Error Code
5 6 7 |
# File 'lib/your_membership/error.rb', line 5 def error_code @error_code end |
#error_description ⇒ String
A Description of what the error means.
5 6 7 |
# File 'lib/your_membership/error.rb', line 5 def error_description @error_description end |
Instance Method Details
#to_s ⇒ String
Returns A highly readable error message.
17 18 19 |
# File 'lib/your_membership/error.rb', line 17 def to_s "Your Membership Returned An Error Code: #{error_code} With Message: #{error_description}" end |