Class: WeatherHacker
- Inherits:
-
Object
- Object
- WeatherHacker
- Defined in:
- lib/weather_hacker.rb,
lib/weather_hacker/client.rb,
lib/weather_hacker/version.rb,
lib/weather_hacker/area_data.rb
Defined Under Namespace
Modules: AreaData Classes: Client
Constant Summary collapse
- VERSION =
"0.1.7"
Instance Method Summary collapse
-
#initialize(zipcode) ⇒ WeatherHacker
constructor
A new instance of WeatherHacker.
-
#on(date) ⇒ Object
return weather data on the received date if the date is not supported, return nil.
Constructor Details
#initialize(zipcode) ⇒ WeatherHacker
Returns a new instance of WeatherHacker.
8 9 10 11 |
# File 'lib/weather_hacker.rb', line 8 def initialize(zipcode) @zipcode = zipcode @client = Client.new end |
Instance Method Details
#on(date) ⇒ Object
return weather data on the received date if the date is not supported, return nil
25 26 27 28 29 30 31 32 |
# File 'lib/weather_hacker.rb', line 25 def on(date) now = Date.today case date when now + 0; today when now + 1; tomorrow when now + 2; day_after_tomorrow end end |