Module: Holidays::Factory::Definition

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

Class Method Summary collapse

Class Method Details

.cache_repositoryObject



82
83
84
# File 'lib/holidays/factory/definition.rb', line 82

def cache_repository
  @cache_repo ||= Holidays::Definition::Repository::Cache.new
end

.custom_method_parserObject



50
51
52
53
54
# File 'lib/holidays/factory/definition.rb', line 50

def custom_method_parser
  Holidays::Definition::Parser::CustomMethod.new(
    custom_method_validator,
  )
end

.custom_method_proc_decoratorObject



56
57
58
# File 'lib/holidays/factory/definition.rb', line 56

def custom_method_proc_decorator
  Holidays::Definition::Decorator::CustomMethodProc.new
end

.custom_method_source_decoratorObject



60
61
62
# File 'lib/holidays/factory/definition.rb', line 60

def custom_method_source_decorator
  Holidays::Definition::Decorator::CustomMethodSource.new
end

.custom_method_validatorObject



70
71
72
# File 'lib/holidays/factory/definition.rb', line 70

def custom_method_validator
  Holidays::Definition::Validator::CustomMethod.new
end

.custom_methods_repositoryObject



90
91
92
# File 'lib/holidays/factory/definition.rb', line 90

def custom_methods_repository
  @custom_methods_repository ||= Holidays::Definition::Repository::CustomMethods.new
end

.file_parserObject



19
20
21
22
23
24
25
# File 'lib/holidays/factory/definition.rb', line 19

def file_parser
  Holidays::Definition::Context::Generator.new(
    custom_method_parser,
    custom_method_source_decorator,
    custom_methods_repository,
  )
end

.function_processorObject



35
36
37
38
39
40
# File 'lib/holidays/factory/definition.rb', line 35

def function_processor
  Holidays::Definition::Context::FunctionProcessor.new(
    custom_methods_repository,
    proc_result_cache_repository,
  )
end

.holidays_by_month_repositoryObject



74
75
76
# File 'lib/holidays/factory/definition.rb', line 74

def holidays_by_month_repository
  @holidays_repo ||= Holidays::Definition::Repository::HolidaysByMonth.new
end

.mergerObject



42
43
44
45
46
47
48
# File 'lib/holidays/factory/definition.rb', line 42

def merger
  Holidays::Definition::Context::Merger.new(
    holidays_by_month_repository,
    regions_repository,
    custom_methods_repository,
  )
end

.proc_result_cache_repositoryObject



86
87
88
# File 'lib/holidays/factory/definition.rb', line 86

def proc_result_cache_repository
  @proc_result_cache_repo ||= Holidays::Definition::Repository::ProcResultCache.new
end

.region_validatorObject



64
65
66
67
68
# File 'lib/holidays/factory/definition.rb', line 64

def region_validator
  Holidays::Definition::Validator::Region.new(
    regions_repository
  )
end

.regions_repositoryObject



78
79
80
# File 'lib/holidays/factory/definition.rb', line 78

def regions_repository
  @regions_repo ||= Holidays::Definition::Repository::Regions.new
end

.source_generatorObject



27
28
29
30
31
32
33
# File 'lib/holidays/factory/definition.rb', line 27

def source_generator
  Holidays::Definition::Context::Generator.new(
    custom_method_parser,
    custom_method_source_decorator,
    custom_methods_repository,
  )
end