Exception: NPR::NPRException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rubynpr/exception.rb

Constant Summary collapse

SYSTEM_ISSUES =
'101'
INVALID_API_KEY =
'310'
DEACTIVATED_API_KEY =
'311'

Instance Attribute Summary collapse

Instance Method Summary collapse

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, message)
  @code, @message = code, message
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



7
8
9
# File 'lib/rubynpr/exception.rb', line 7

def code
  @code
end

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/rubynpr/exception.rb', line 7

def message
  @message
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/rubynpr/exception.rb', line 13

def to_s
  "#{ @code }: #{ @message }"
end