Class: EveApp::XmlApi::Calls::ErrorResponse

Inherits:
Base
  • Object
show all
Defined in:
lib/eve_app/xml_api/calls.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#cached_until, #results, #xml

Instance Method Summary collapse

Methods inherited from Base

#ids, #merge

Constructor Details

#initialize(exception, call = nil, params = {}) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



171
172
173
174
175
# File 'lib/eve_app/xml_api/calls.rb', line 171

def initialize(exception, call=nil, params={})
  @exception = exception
  @call = call
  @params = params
end

Instance Attribute Details

#callObject (readonly)

Returns the value of attribute call.



169
170
171
# File 'lib/eve_app/xml_api/calls.rb', line 169

def call
  @call
end

#exceptionObject (readonly)

Returns the value of attribute exception.



169
170
171
# File 'lib/eve_app/xml_api/calls.rb', line 169

def exception
  @exception
end

#paramsObject (readonly)

Returns the value of attribute params.



169
170
171
# File 'lib/eve_app/xml_api/calls.rb', line 169

def params
  @params
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


177
178
179
# File 'lib/eve_app/xml_api/calls.rb', line 177

def error?
  true
end

#titleObject



181
182
183
# File 'lib/eve_app/xml_api/calls.rb', line 181

def title
  exception.http_body.scan(/<title>(.+?)<\/title>/).flatten[0]
end

#to_sObject



185
186
187
188
189
190
191
192
193
# File 'lib/eve_app/xml_api/calls.rb', line 185

def to_s
  puts "================================"
  puts "API Error: #{exception.class}"
  puts "title: #{title}"
  puts "body: #{exception.http_body}"
  puts "call: #{call}"
  puts "params: #{params.inspect}"
  puts "================================"
end