Class: WeatherScraper::DailyWeather
- Inherits:
-
Object
- Object
- WeatherScraper::DailyWeather
- Includes:
- NameMapping
- Defined in:
- lib/weathers/weather_scraper/daily_weather.rb
Overview
parse daily weather description from cwb website
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
Methods included from NameMapping
Constructor Details
#initialize(city) ⇒ DailyWeather
Returns a new instance of DailyWeather.
12 13 14 15 |
# File 'lib/weathers/weather_scraper/daily_weather.rb', line 12 def initialize(city) @city = city_mapping(city).delete("_") parse_html(city_mapping(city)) end |
Instance Method Details
#city ⇒ Object
17 18 19 |
# File 'lib/weathers/weather_scraper/daily_weather.rb', line 17 def city @city end |
#tips ⇒ Object
25 26 27 |
# File 'lib/weathers/weather_scraper/daily_weather.rb', line 25 def tips @tips ||= parse_tips end |
#weathers ⇒ Object
21 22 23 |
# File 'lib/weathers/weather_scraper/daily_weather.rb', line 21 def weathers @weathers ||= parse_weathers end |