Module: Holidays::Factory::Finder

Defined in:
lib/holidays/factory/finder.rb

Class Method Summary collapse

Class Method Details

.betweenObject



23
24
25
26
27
28
29
# File 'lib/holidays/factory/finder.rb', line 23

def between
  Holidays::Finder::Context::Between.new(
    search,
    dates_driver_builder,
    parse_options,
  )
end

.next_holidayObject



31
32
33
34
35
36
37
# File 'lib/holidays/factory/finder.rb', line 31

def next_holiday
  Holidays::Finder::Context::NextHoliday.new(
    search,
    dates_driver_builder,
    parse_options,
  )
end

.parse_optionsObject



47
48
49
50
51
52
53
# File 'lib/holidays/factory/finder.rb', line 47

def parse_options
  Holidays::Finder::Context::ParseOptions.new(
    Factory::Definition.regions_repository,
    Factory::Definition.region_validator,
    Factory::Definition.merger,
  )
end

.searchObject



14
15
16
17
18
19
20
21
# File 'lib/holidays/factory/finder.rb', line 14

def search
  Holidays::Finder::Context::Search.new(
    Factory::Definition.holidays_by_month_repository,
    Factory::Definition.function_processor,
    Factory::DateCalculator.day_of_month_calculator,
    rules,
  )
end

.year_holidayObject



39
40
41
42
43
44
45
# File 'lib/holidays/factory/finder.rb', line 39

def year_holiday
  Holidays::Finder::Context::YearHoliday.new(
    search,
    dates_driver_builder,
    parse_options,
  )
end