Exception: TimeDoctor::TimeDoctorError

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

Direct Known Subclasses

UnknownError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ TimeDoctorError

Returns a new instance of TimeDoctorError.



3
4
5
6
7
# File 'lib/timedoctor/exceptions.rb', line 3

def initialize(response)
  @code    = response.status
  @body    = JSON.parse(response.body)
  @message = create_message
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



9
10
11
# File 'lib/timedoctor/exceptions.rb', line 9

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/timedoctor/exceptions.rb', line 9

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



9
10
11
# File 'lib/timedoctor/exceptions.rb', line 9

def message
  @message
end