Module: Holidays::Definition::CustomMethods::CL

Defined in:
lib/holidays/definition/custom_methods/cl.rb

Overview

cl custom holiday calculations, ported verbatim from the methods: block in definitions/cl.yaml.

Class Method Summary collapse

Class Method Details

.columbus_day_cl(year) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/holidays/definition/custom_methods/cl.rb', line 20

def columbus_day_cl(year)
  date = Date.civil(year, 10, 12)
  if [2,3,4].include?(date.wday)
    date -= (date.wday - 1)
  elsif date.wday == 5
    date += 3
  end
  date
end

.other_churches_day_cl(year) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/holidays/definition/custom_methods/cl.rb', line 30

def other_churches_day_cl(year)
  date = Date.civil(year, 10, 31)
  if date.wday == 2
    date -= 4
  elsif date.wday == 3
    date += 2
  end
  date
end

.st_peter_st_paul_cl(year) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/holidays/definition/custom_methods/cl.rb', line 10

def st_peter_st_paul_cl(year)
  date = Date.civil(year, 6, 29)
  if [2,3,4].include?(date.wday)
    date -= (date.wday - 1)
  elsif date.wday == 5
    date += 3
  end
  date
end