Class: Weatherstorm::Forecast
- Inherits:
-
Object
- Object
- Weatherstorm::Forecast
- Defined in:
- lib/weatherstorm/forecast.rb
Overview
Gets the forecast for a location
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ Forecast
constructor
A new instance of Forecast.
Constructor Details
#initialize(args) ⇒ Forecast
Returns a new instance of Forecast.
7 8 9 10 11 12 |
# File 'lib/weatherstorm/forecast.rb', line 7 def initialize(args) @location = args.fetch(:location) @time = args.fetch(:time) @api = args[:api_key] ForecastIO.api_key = api end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
6 7 8 |
# File 'lib/weatherstorm/forecast.rb', line 6 def api @api end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
6 7 8 |
# File 'lib/weatherstorm/forecast.rb', line 6 def location @location end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
6 7 8 |
# File 'lib/weatherstorm/forecast.rb', line 6 def time @time end |