Module: Timetress::Norway::Holiday

Includes:
Holiday
Included in:
Timetress::Norway
Defined in:
lib/timetress/norway/holiday.rb

Constant Summary collapse

MAY =
5
NOVEMBER =
11

Constants included from Holiday

Holiday::DECEMBER, Holiday::FEBRUARY, Holiday::JANUARY

Instance Method Summary collapse

Methods included from Holiday

#ascension, #boxing_day, #christmas, #christmas_eve, #easter_monday, #easter_sunday, #good_friday, #maundy_thursday, #new_years_day, #pentecost_monday, #pentecost_sunday, #valentines_day

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Timetress::Holiday

Instance Method Details

#fathersday(year) ⇒ Object



13
14
15
# File 'lib/timetress/norway/holiday.rb', line 13

def fathersday(year)
  second_sunday_in(NOVEMBER, year)
end

#labour_day(year) ⇒ Object Also known as: labor_day



17
18
19
# File 'lib/timetress/norway/holiday.rb', line 17

def labour_day(year)
  Date.new(year, MAY, 1)
end

#mothersday(year) ⇒ Object



9
10
11
# File 'lib/timetress/norway/holiday.rb', line 9

def mothersday(year)
  second_sunday_in(FEBRUARY, year)
end

#national_holiday(year) ⇒ Object



22
23
24
# File 'lib/timetress/norway/holiday.rb', line 22

def national_holiday(year)
  Date.new(year, MAY, 17)
end

#official_holidays(year) ⇒ Object Also known as: public_holidays, legal_holidays



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/timetress/norway/holiday.rb', line 26

def official_holidays(year)
  [
    new_years_day(year),
    maundy_thursday(year),
    good_friday(year),
    easter_sunday(year),
    easter_monday(year),
    labor_day(year),
    national_holiday(year),
    ascension(year),
    pentecost_sunday(year),
    pentecost_monday(year),
    christmas(year),
    boxing_day(year)
  ]
end