Class: DailyWeatherScraper::DailyWeather
- Inherits:
-
Object
- Object
- DailyWeatherScraper::DailyWeather
- Defined in:
- lib/weatherdesc/daily_weather.rb
Overview
parse course description from sharecourse web
Constant Summary collapse
- CWB_URL =
"http://www.cwb.gov.tw"- CITY_WEATHER_URL =
"#{CWB_URL}/V7/forecast/taiwan/"
Instance Method Summary collapse
- #city ⇒ Object
-
#initialize(city) ⇒ DailyWeather
constructor
A new instance of DailyWeather.
- #tips ⇒ Object
- #weathers ⇒ Object
Constructor Details
#initialize(city) ⇒ DailyWeather
Returns a new instance of DailyWeather.
10 11 12 13 |
# File 'lib/weatherdesc/daily_weather.rb', line 10 def initialize(city) @city = name_mapping(city).delete("_") parse_html(name_mapping(city)) end |
Instance Method Details
#city ⇒ Object
15 16 17 |
# File 'lib/weatherdesc/daily_weather.rb', line 15 def city @city end |
#tips ⇒ Object
23 24 25 |
# File 'lib/weatherdesc/daily_weather.rb', line 23 def tips @tips ||= parse_tips end |
#weathers ⇒ Object
19 20 21 |
# File 'lib/weatherdesc/daily_weather.rb', line 19 def weathers @weathers ||= parse_weathers end |