Exception: TravelTimeAPI::ServerError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/traveltime_api.rb

Overview

Raised if API server has encountered an error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ ServerError

Returns a new instance of ServerError.



45
46
47
# File 'lib/traveltime_api.rb', line 45

def initialize(error)
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Human readable error message.



43
44
45
# File 'lib/traveltime_api.rb', line 43

def error
  @error
end

Instance Method Details

#to_sObject



49
50
51
# File 'lib/traveltime_api.rb', line 49

def to_s
  "TravelTimeAPI::ServerError[#{@error}]"
end