Exception: Cronofy::APIError

Inherits:
CronofyError show all
Defined in:
lib/cronofy/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response = nil) ⇒ APIError

Returns a new instance of APIError.



14
15
16
17
# File 'lib/cronofy/errors.rb', line 14

def initialize(message, response=nil)
  super(message)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/cronofy/errors.rb', line 12

def response
  @response
end

Instance Method Details

#bodyObject



19
20
21
# File 'lib/cronofy/errors.rb', line 19

def body
  response.body if response
end

#headersObject



23
24
25
# File 'lib/cronofy/errors.rb', line 23

def headers
  response.headers if response
end

#inspectObject



27
28
29
# File 'lib/cronofy/errors.rb', line 27

def inspect
  "<#{self.class.name} message=#{message} headers=#{headers.inspect} body=#{body}>"
end