Exception: NasaApi::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/nasa_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



10
11
12
13
14
# File 'lib/nasa_api.rb', line 10

def initialize(response)
  @http_code = response.code
  @http_msg = response.message
  @message = response['error']['message'] if response['error']
end

Instance Attribute Details

#http_codeObject (readonly)

Returns the value of attribute http_code.



8
9
10
# File 'lib/nasa_api.rb', line 8

def http_code
  @http_code
end

#http_msgObject (readonly)

Returns the value of attribute http_msg.



8
9
10
# File 'lib/nasa_api.rb', line 8

def http_msg
  @http_msg
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/nasa_api.rb', line 8

def message
  @message
end