Exception: Eventful::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/eventful/api.rb

Overview

An error that may also include the YAML response from the server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIError

Creates a new exception.



142
143
144
145
# File 'lib/eventful/api.rb', line 142

def initialize(response)
  super
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



139
140
141
# File 'lib/eventful/api.rb', line 139

def response
  @response
end

Instance Method Details

#to_sObject

The error string returned by the API call.



148
149
150
# File 'lib/eventful/api.rb', line 148

def to_s
  "#{@response['string']}: #{@response['description']}"
end