Class: AeegTime

Inherits:
EnergyTime show all
Includes:
ItalianHolidays
Defined in:
lib/aeeg_time.rb

Constant Summary

Constants included from EasterDates

EasterDates::EASTERS

Instance Method Summary collapse

Methods included from ItalianHolidays

included

Methods included from EasterDates

included

Methods inherited from EnergyTime

#+, #holiday?, #hour_count, #hour_in?, #interval

Instance Method Details

#aeeg_band(return_a_number = false) ⇒ Object

Fascie orarie definite nell’Allegato A, tabella 6, deliberazione 301/12



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/aeeg_time.rb', line 11

def aeeg_band(return_a_number=false)
  n = case
  when holiday?
    3
  when !saturday? && hour_in?(8...19)
    1
  when saturday? && hour_in?(7...23)
    2
  when !saturday? && hour_in?(7...23)
    2
  else
    3
  end
  return_a_number ? n : "F#{n}"
end