Exception: Geoloqi::ApiError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, type, reason = nil) ⇒ ApiError

Returns a new instance of ApiError.



4
5
6
7
8
9
10
11
12
# File 'lib/geoloqi/error.rb', line 4

def initialize(status, type, reason=nil)
  @status = status
  @type = type
  @reason = reason
  message = type
  message += " - #{reason}" if reason
  message += " (#{status})"
  super message
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



3
4
5
# File 'lib/geoloqi/error.rb', line 3

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/geoloqi/error.rb', line 3

def status
  @status
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/geoloqi/error.rb', line 3

def type
  @type
end