Class: OpenWeatherMap::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/open_weather_map/base.rb

Direct Known Subclasses

City, Geocode

Instance Method Summary collapse

Instance Method Details

#condObject



6
7
8
# File 'lib/open_weather_map/base.rb', line 6

def cond
  @response['weather'][0]['main']
end

#cond_jpObject



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_maxObject



14
15
16
# File 'lib/open_weather_map/base.rb', line 14

def temp_max
  @response['main']['temp_max']
end

#temp_max_celsiusObject



35
36
37
# File 'lib/open_weather_map/base.rb', line 35

def temp_max_celsius
  to_celsius @response['main']['temp_max']
end

#temp_minObject



10
11
12
# File 'lib/open_weather_map/base.rb', line 10

def temp_min
  @response['main']['temp_min']
end

#temp_min_celsiusObject



31
32
33
# File 'lib/open_weather_map/base.rb', line 31

def temp_min_celsius
  to_celsius @response['main']['temp_min']
end