Class: Tenkit::CurrentWeather

Inherits:
Object
  • Object
show all
Defined in:
lib/tenkit/current_weather.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current_weather) ⇒ CurrentWeather

Returns a new instance of CurrentWeather.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/tenkit/current_weather.rb', line 23

def initialize(current_weather)
  return if current_weather.nil?

  @as_of = current_weather['asOf']
  @cloud_cover = current_weather['cloudCover']
  @condition_code = current_weather['conditionCode']
  @daylight = current_weather['daylight']
  @humidity = current_weather['humidity']
   = .new(current_weather['metadata'])
  @precipitation_intensity = current_weather['precipitationIntensity']
  @pressure = current_weather['pressure']
  @pressure_trend = current_weather['pressureTrend']
  @temperature = current_weather['temperature']
  @temperature_apparent = current_weather['temperatureApparent']
  @temperature_dew_point = current_weather['temperatureDewPoint']
  @uv_index = current_weather['uvIndex']
  @visibility = current_weather['visibility']
  @wind_direction = current_weather['windDirection']
  @wind_gust = current_weather['windGust']
  @wind_speed = current_weather['windSpeed']
end

Instance Attribute Details

#as_ofObject (readonly)

Returns the value of attribute as_of.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def as_of
  @as_of
end

#cloud_coverObject (readonly)

Returns the value of attribute cloud_cover.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def cloud_cover
  @cloud_cover
end

#condition_codeObject (readonly)

Returns the value of attribute condition_code.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def condition_code
  @condition_code
end

#daylightObject (readonly)

Returns the value of attribute daylight.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def daylight
  @daylight
end

#humidityObject (readonly)

Returns the value of attribute humidity.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def humidity
  @humidity
end

#metadataObject (readonly)

Returns the value of attribute metadata.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def 
  
end

#precipitation_intensityObject (readonly)

Returns the value of attribute precipitation_intensity.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def precipitation_intensity
  @precipitation_intensity
end

#pressureObject (readonly)

Returns the value of attribute pressure.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def pressure
  @pressure
end

#pressure_trendObject (readonly)

Returns the value of attribute pressure_trend.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def pressure_trend
  @pressure_trend
end

#temperatureObject (readonly)

Returns the value of attribute temperature.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def temperature
  @temperature
end

#temperature_apparentObject (readonly)

Returns the value of attribute temperature_apparent.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def temperature_apparent
  @temperature_apparent
end

#temperature_dew_pointObject (readonly)

Returns the value of attribute temperature_dew_point.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def temperature_dew_point
  @temperature_dew_point
end

#uv_indexObject (readonly)

Returns the value of attribute uv_index.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def uv_index
  @uv_index
end

#visibilityObject (readonly)

Returns the value of attribute visibility.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def visibility
  @visibility
end

#wind_directionObject (readonly)

Returns the value of attribute wind_direction.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def wind_direction
  @wind_direction
end

#wind_gustObject (readonly)

Returns the value of attribute wind_gust.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def wind_gust
  @wind_gust
end

#wind_speedObject (readonly)

Returns the value of attribute wind_speed.



5
6
7
# File 'lib/tenkit/current_weather.rb', line 5

def wind_speed
  @wind_speed
end