Exception: NPR::NPRException
- Inherits:
-
StandardError
- Object
- StandardError
- NPR::NPRException
- Defined in:
- lib/rubynpr/exception.rb
Direct Known Subclasses
DeactivatedAPIKey, InvalidAPIKey, InvalidList, InvalidQueryOptions, NPRSystemIssues
Constant Summary collapse
- SYSTEM_ISSUES =
'101'
- INVALID_API_KEY =
'310'
- DEACTIVATED_API_KEY =
'311'
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(code, message) ⇒ NPRException
constructor
A new instance of NPRException.
- #to_s ⇒ Object
Constructor Details
#initialize(code, message) ⇒ NPRException
Returns a new instance of NPRException.
9 10 11 |
# File 'lib/rubynpr/exception.rb', line 9 def initialize(code, ) @code, @message = code, end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
7 8 9 |
# File 'lib/rubynpr/exception.rb', line 7 def code @code end |
#message ⇒ Object
Returns the value of attribute message.
7 8 9 |
# File 'lib/rubynpr/exception.rb', line 7 def @message end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/rubynpr/exception.rb', line 13 def to_s "#{ @code }: #{ @message }" end |