Exception: MultiInfo::API::Error

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

Overview

MultiInfo API Error exception.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ Error

Returns a new instance of Error.



8
9
10
# File 'lib/multiinfo/api/error.rb', line 8

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/multiinfo/api/error.rb', line 6

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/multiinfo/api/error.rb', line 6

def message
  @message
end

Class Method Details

.parse(error_arr) ⇒ Object

Creates a new Error from a MultiInfo HTTP response string



13
14
15
16
# File 'lib/multiinfo/api/error.rb', line 13

def self.parse(error_arr)
  code, message = error_arr
  self.new(code, message)
end