Exception: PubChemAPI::APIError

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

Overview

Custom exception class for API errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code = nil) ⇒ APIError

Returns a new instance of APIError.



9
10
11
12
# File 'lib/pubchem_api.rb', line 9

def initialize(message, code = nil)
  super(message)
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end