Exception: WeatherSage::HTTP::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/weather-sage/http/error.rb

Overview

HTTP error wrapper.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, code, resp) ⇒ Error

Create Error instance from URL, response code, and response.



10
11
12
13
14
# File 'lib/weather-sage/http/error.rb', line 10

def initialize(url, code, resp)
  @url = url.freeze
  @code = code.freeze
  @response = resp.freeze
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/weather-sage/http/error.rb', line 5

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/weather-sage/http/error.rb', line 5

def response
  @response
end

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/weather-sage/http/error.rb', line 5

def url
  @url
end