Class: Kisyo::Element::Day

Inherits:
Object
  • Object
show all
Defined in:
lib/kisyo/elements/day.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_, _, precipitation_total, precipitation_hourly_max, precipitation_10min_max, temperature_avg, temperature_max, temperature_min, humidity_avg, humidity_min, _, _, _, _, _, day_length, _, _, general_weather_condition_day, general_weather_condition_night) ⇒ Day

Returns a new instance of Day.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/kisyo/elements/day.rb', line 18

def initialize(
      _, _,
      precipitation_total,
      precipitation_hourly_max,
      precipitation_10min_max,
      temperature_avg,
      temperature_max,
      temperature_min,
      humidity_avg,
      humidity_min,
      _, _, _, _, _,
      day_length,
      _, _,
      general_weather_condition_day,
      general_weather_condition_night
    )
  @precipitation_total = convert_value(precipitation_total)
  @precipitation_hourly_max = convert_value(precipitation_hourly_max)
  @precipitation_10min_max = convert_value(precipitation_10min_max)
  @temperature_avg = convert_value(temperature_avg)
  @temperature_max = convert_value(temperature_max)
  @temperature_min = convert_value(temperature_min)
  @humidity_avg = convert_value(humidity_avg)
  @humidity_min = convert_value(humidity_min)
  @day_length = convert_value(day_length)
  @general_weather_condition_day = general_weather_condition_day
  @general_weather_condition_night = general_weather_condition_night
end

Instance Attribute Details

#day_lengthObject (readonly)

Returns the value of attribute day_length.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def day_length
  @day_length
end

#general_weather_condition_dayObject (readonly)

Returns the value of attribute general_weather_condition_day.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def general_weather_condition_day
  @general_weather_condition_day
end

#general_weather_condition_nightObject (readonly)

Returns the value of attribute general_weather_condition_night.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def general_weather_condition_night
  @general_weather_condition_night
end

#humidity_avgObject (readonly)

Returns the value of attribute humidity_avg.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def humidity_avg
  @humidity_avg
end

#humidity_minObject (readonly)

Returns the value of attribute humidity_min.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def humidity_min
  @humidity_min
end

#precipitation_10min_maxObject (readonly)

Returns the value of attribute precipitation_10min_max.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def precipitation_10min_max
  @precipitation_10min_max
end

#precipitation_hourly_maxObject (readonly)

Returns the value of attribute precipitation_hourly_max.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def precipitation_hourly_max
  @precipitation_hourly_max
end

#precipitation_totalObject (readonly)

Returns the value of attribute precipitation_total.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def precipitation_total
  @precipitation_total
end

#temperature_avgObject (readonly)

Returns the value of attribute temperature_avg.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def temperature_avg
  @temperature_avg
end

#temperature_maxObject (readonly)

Returns the value of attribute temperature_max.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def temperature_max
  @temperature_max
end

#temperature_minObject (readonly)

Returns the value of attribute temperature_min.



4
5
6
# File 'lib/kisyo/elements/day.rb', line 4

def temperature_min
  @temperature_min
end

Instance Method Details

#convert_value(value) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/kisyo/elements/day.rb', line 47

def convert_value(value)
  case value
  when '--'
    nil
  else
    value.to_f
  end
end