Class: RelicLink::Coh3::Api::Errors::RelicError

Inherits:
Faraday::Error
  • Object
show all
Defined in:
lib/relic_link/coh3/api/errors/relic_error.rb

Overview

Base wrapper for Relic CoH3 API errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response = nil) ⇒ RelicError

Returns a new instance of RelicError.



11
12
13
14
# File 'lib/relic_link/coh3/api/errors/relic_error.rb', line 11

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

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



9
10
11
# File 'lib/relic_link/coh3/api/errors/relic_error.rb', line 9

def response
  @response
end

Instance Method Details

#errorObject



16
17
18
# File 'lib/relic_link/coh3/api/errors/relic_error.rb', line 16

def error
  response.body.error
end

#errorsObject



20
21
22
# File 'lib/relic_link/coh3/api/errors/relic_error.rb', line 20

def errors
  response.body.errors
end

#response_metadataObject



24
25
26
# File 'lib/relic_link/coh3/api/errors/relic_error.rb', line 24

def 
  response.body.
end