Class: NasaApod::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/nasa_apod/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



6
7
8
9
10
# File 'lib/nasa_apod/error.rb', line 6

def initialize(response)
  @code = response.code
  @code_definition = response.message
  @message = response["error"]["message"] if response["error"]
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/nasa_apod/error.rb', line 4

def code
  @code
end

#code_definitionObject (readonly)

Returns the value of attribute code_definition.



4
5
6
# File 'lib/nasa_apod/error.rb', line 4

def code_definition
  @code_definition
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/nasa_apod/error.rb', line 4

def message
  @message
end