Class: OpenWeatherMap::Base
- Inherits:
-
Object
- Object
- OpenWeatherMap::Base
- Defined in:
- lib/open_weather_map/base.rb
Instance Method Summary collapse
- #cond ⇒ Object
- #cond_jp ⇒ Object
- #temp_max ⇒ Object
- #temp_max_celsius ⇒ Object
- #temp_min ⇒ Object
- #temp_min_celsius ⇒ Object
Instance Method Details
#cond ⇒ Object
6 7 8 |
# File 'lib/open_weather_map/base.rb', line 6 def cond @response['weather'][0]['main'] end |
#cond_jp ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/open_weather_map/base.rb', line 18 def cond_jp jp_cond = '' case @response['weather'][0]['main'] when 'Clear' then jp_cond = '晴れ' when 'Clouds' then jp_cond = '曇り' when 'Snow' then jp_cond = '雪' when 'Rain' then jp_cond = '雨' else jp_cond = 'その他' end return jp_cond end |
#temp_max ⇒ Object
14 15 16 |
# File 'lib/open_weather_map/base.rb', line 14 def temp_max @response['main']['temp_max'] end |
#temp_max_celsius ⇒ Object
35 36 37 |
# File 'lib/open_weather_map/base.rb', line 35 def temp_max_celsius to_celsius @response['main']['temp_max'] end |
#temp_min ⇒ Object
10 11 12 |
# File 'lib/open_weather_map/base.rb', line 10 def temp_min @response['main']['temp_min'] end |
#temp_min_celsius ⇒ Object
31 32 33 |
# File 'lib/open_weather_map/base.rb', line 31 def temp_min_celsius to_celsius @response['main']['temp_min'] end |