Exception: Vericred::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/vericred/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



5
6
7
# File 'lib/vericred/errors.rb', line 5

def initialize(response)
  @response = response
end

Instance Method Details

#errorsObject



9
10
11
# File 'lib/vericred/errors.rb', line 9

def errors
  OpenStruct.new(JSON.parse(response.content).try(:[], 'errors') || {})
end

#statusObject



13
14
15
# File 'lib/vericred/errors.rb', line 13

def status
  response.status
end