Exception: GHI::Client::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/ghi/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



15
16
17
# File 'lib/ghi/client.rb', line 15

def initialize response
  @response, @json = response, JSON.parse(response.body)
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



14
15
16
# File 'lib/ghi/client.rb', line 14

def response
  @response
end

Instance Method Details

#bodyObject



19
# File 'lib/ghi/client.rb', line 19

def body()    @json             end

#errorsObject



21
# File 'lib/ghi/client.rb', line 21

def errors()  [*body['errors']] end

#messageObject



20
# File 'lib/ghi/client.rb', line 20

def message() body['message']   end