Class: Accuweather::Conditions::ForecastWeather

Inherits:
Object
  • Object
show all
Defined in:
lib/accuweather/conditions/forecast_weather.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(weather_text:, weather_text_long:, weather_icon:, high_temperature:, low_temperature:, real_feel_high:, real_feel_low:, wind_speed:, wind_direction:, wind_gust:, max_uv:, rain_amount:, snow_amount:, ice_amount:, precipitation_amount:, thunderstorm_probability:, rain_probability:, snow_probability:, ice_probability:, precipitation_probability:) ⇒ ForecastWeather

Returns a new instance of ForecastWeather.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/accuweather/conditions/forecast_weather.rb', line 6

def initialize(weather_text:, weather_text_long:, weather_icon:, high_temperature:, low_temperature:, real_feel_high:, real_feel_low:, wind_speed:, wind_direction:, wind_gust:, max_uv:, rain_amount:, snow_amount:, ice_amount:, precipitation_amount:, thunderstorm_probability:, rain_probability:, snow_probability:, ice_probability:, precipitation_probability:)
  @weather_text = weather_text
  @weather_text_long = weather_text_long
  @weather_icon = weather_icon
  @high_temperature = high_temperature
  @low_temperature = low_temperature
  @real_feel_high = real_feel_high
  @real_feel_low = real_feel_low
  @wind_speed = wind_speed
  @wind_direction = wind_direction
  @wind_gust = wind_gust
  @max_uv = max_uv
  @rain_amount = rain_amount
  @snow_amount = snow_amount
  @ice_amount = ice_amount
  @precipitation_amount = precipitation_amount
  @thunderstorm_probability = thunderstorm_probability
  @rain_probability = rain_probability
  @snow_probability = snow_probability
  @ice_probability = ice_probability
  @precipitation_probability = precipitation_probability
end

Instance Attribute Details

#high_temperatureObject (readonly)

Returns the value of attribute high_temperature.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def high_temperature
  @high_temperature
end

#ice_amountObject (readonly)

Returns the value of attribute ice_amount.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def ice_amount
  @ice_amount
end

#ice_probabilityObject (readonly)

Returns the value of attribute ice_probability.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def ice_probability
  @ice_probability
end

#low_temperatureObject (readonly)

Returns the value of attribute low_temperature.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def low_temperature
  @low_temperature
end

#max_uvObject (readonly)

Returns the value of attribute max_uv.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def max_uv
  @max_uv
end

#precipitation_amountObject (readonly)

Returns the value of attribute precipitation_amount.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def precipitation_amount
  @precipitation_amount
end

#precipitation_probabilityObject (readonly)

Returns the value of attribute precipitation_probability.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def precipitation_probability
  @precipitation_probability
end

#rain_amountObject (readonly)

Returns the value of attribute rain_amount.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def rain_amount
  @rain_amount
end

#rain_probabilityObject (readonly)

Returns the value of attribute rain_probability.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def rain_probability
  @rain_probability
end

#real_feel_highObject (readonly)

Returns the value of attribute real_feel_high.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def real_feel_high
  @real_feel_high
end

#real_feel_lowObject (readonly)

Returns the value of attribute real_feel_low.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def real_feel_low
  @real_feel_low
end

#snow_amountObject (readonly)

Returns the value of attribute snow_amount.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def snow_amount
  @snow_amount
end

#snow_probabilityObject (readonly)

Returns the value of attribute snow_probability.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def snow_probability
  @snow_probability
end

#thunderstorm_probabilityObject (readonly)

Returns the value of attribute thunderstorm_probability.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def thunderstorm_probability
  @thunderstorm_probability
end

#weather_iconObject (readonly)

Returns the value of attribute weather_icon.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def weather_icon
  @weather_icon
end

#weather_textObject (readonly)

Returns the value of attribute weather_text.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def weather_text
  @weather_text
end

#weather_text_longObject (readonly)

Returns the value of attribute weather_text_long.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def weather_text_long
  @weather_text_long
end

#wind_directionObject (readonly)

Returns the value of attribute wind_direction.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def wind_direction
  @wind_direction
end

#wind_gustObject (readonly)

Returns the value of attribute wind_gust.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def wind_gust
  @wind_gust
end

#wind_speedObject (readonly)

Returns the value of attribute wind_speed.



4
5
6
# File 'lib/accuweather/conditions/forecast_weather.rb', line 4

def wind_speed
  @wind_speed
end

Instance Method Details

#==(other) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/accuweather/conditions/forecast_weather.rb', line 29

def ==(other)
  weather_text == other.weather_text &&
  weather_text_long == other.weather_text_long &&
  weather_icon == other.weather_icon &&
  high_temperature == other.high_temperature &&
  low_temperature == other.low_temperature &&
  real_feel_high == other.real_feel_high &&
  real_feel_low == other.real_feel_low &&
  wind_speed == other.wind_speed &&
  wind_direction == other.wind_direction &&
  wind_gust == other.wind_gust &&
  max_uv == other.max_uv &&
  rain_amount == other.rain_amount &&
  snow_amount == other.snow_amount &&
  ice_amount == other.ice_amount &&
  precipitation_amount == other.precipitation_amount &&
  thunderstorm_probability == other.thunderstorm_probability &&
  rain_probability == other.rain_probability &&
  snow_probability == other.snow_probability &&
  ice_probability == other.ice_probability &&
  precipitation_probability == other.precipitation_probability
rescue NoMethodError
  false
end

#to_sObject



54
55
56
# File 'lib/accuweather/conditions/forecast_weather.rb', line 54

def to_s
  "weather_text: #{weather_text}, weather_text_long: #{weather_text_long}, weather_icon: #{weather_icon}, high_temperature: #{high_temperature}, low_temperature: #{low_temperature}, real_feel_high: #{real_feel_high}, real_feel_low: #{real_feel_low}, wind_speed: #{wind_speed}, wind_direction: #{wind_direction}, wind_gust: #{wind_gust}, max_uv: #{max_uv}, rain_amount: #{rain_amount}, snow_amount: #{snow_amount}, ice_amount: #{ice_amount}, precipitation_amount: #{precipitation_amount}, thunderstorm_probability: #{thunderstorm_probability}, rain_probability: #{rain_probability}, snow_probability: #{snow_probability}, ice_probability: #{ice_probability}, precipitation_probability: #{precipitation_probability}"
end