Exception: AruxApp::API::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ Error

Returns a new instance of Error.



45
46
47
48
49
50
51
52
53
# File 'lib/arux_app/api.rb', line 45

def initialize(code, message)
  self.http_status_code = code.to_i
  begin
    self.json = JSON.parse(message)
  rescue
  end

  super "(#{code}) #{message}"
end

Instance Attribute Details

#http_status_codeObject

Returns the value of attribute http_status_code.



44
45
46
# File 'lib/arux_app/api.rb', line 44

def http_status_code
  @http_status_code
end