4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/holidays/load_all_definitions.rb', line 4
def call
global_methods = {
"easter(year)" => gregorian_easter.method(:calculate_easter_for).to_proc,
"orthodox_easter(year)" => gregorian_easter.method(:calculate_orthodox_easter_for).to_proc,
"orthodox_easter_julian(year)" => julian_easter.method(:calculate_orthodox_easter_for).to_proc,
"to_monday_if_sunday(date)" => weekend_modifier.method(:to_monday_if_sunday).to_proc,
"to_monday_if_weekend(date)" => weekend_modifier.method(:to_monday_if_weekend).to_proc,
"to_weekday_if_boxing_weekend(date)" => weekend_modifier.method(:to_weekday_if_boxing_weekend).to_proc,
"to_weekday_if_boxing_weekend_from_year(year)" => weekend_modifier.method(:to_weekday_if_boxing_weekend_from_year).to_proc,
"to_weekday_if_weekend(date)" => weekend_modifier.method(:to_weekday_if_weekend).to_proc,
"calculate_day_of_month(year, month, day, wday)" => day_of_month_calculator.method(:call).to_proc,
"to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday(year)" => weekend_modifier.method(:to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday).to_proc,
"xmas_to_weekday_if_weekend(year)" => weekend_modifier.method(:xmas_to_weekday_if_weekend).to_proc,
"to_tuesday_if_sunday_or_monday_if_saturday(date)" => weekend_modifier.method(:to_tuesday_if_sunday_or_monday_if_saturday).to_proc,
}
Factory::Definition.custom_methods_repository.add(global_methods)
end
|