Class: DailyWeatherScraper::DailyWeather

Inherits:
Object
  • Object
show all
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

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

#cityObject



15
16
17
# File 'lib/weatherdesc/daily_weather.rb', line 15

def city
  @city
end

#tipsObject



23
24
25
# File 'lib/weatherdesc/daily_weather.rb', line 23

def tips
  @tips ||= parse_tips
end

#weathersObject



19
20
21
# File 'lib/weatherdesc/daily_weather.rb', line 19

def weathers
  @weathers ||= parse_weathers
end