Class: ADN::API::Response

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/adn/api/response.rb

Instance Method Summary collapse

Instance Method Details

#error_messageObject



14
15
16
# File 'lib/adn/api/response.rb', line 14

def error_message
  self.fetch('meta').fetch('error_message')
end

#has_error?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'lib/adn/api/response.rb', line 8

def has_error?
  self['meta'].nil? ||
  self['meta']['code'].nil? ||
  self['meta']['code'] >= HTTP_ERROR
end