Class: Forecast::IO::Cache::Generate
- Inherits:
-
Object
- Object
- Forecast::IO::Cache::Generate
- Defined in:
- lib/forecast_io/cache/generate.rb
Class Method Summary collapse
Instance Method Summary collapse
- #forecasts ⇒ Object
-
#initialize(lat, lon, time, cache, api = ::Forecast::IO) ⇒ Generate
constructor
A new instance of Generate.
Constructor Details
Class Method Details
.for(lat, lon, time, cache) ⇒ Object
8 9 10 |
# File 'lib/forecast_io/cache/generate.rb', line 8 def self.for lat, lon, time, cache new(lat, lon, time, cache).forecasts.first end |
Instance Method Details
#forecasts ⇒ Object
16 17 18 19 20 |
# File 'lib/forecast_io/cache/generate.rb', line 16 def forecasts ([current] + hourly).map do |forecast| @cache.store generate forecast end end |