Module: Holidays::Factory::Definition

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

Class Method Summary collapse

Class Method Details

.cache_repositoryObject



98
99
100
# File 'lib/holidays/factory/definition.rb', line 98

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

.custom_method_parserObject



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

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

.custom_method_proc_decoratorObject



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

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

.custom_method_source_decoratorObject



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

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

.custom_method_validatorObject



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

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

.custom_methods_repositoryObject



106
107
108
# File 'lib/holidays/factory/definition.rb', line 106

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

.file_parserObject



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

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

.function_processorObject



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

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

.holidays_by_month_repositoryObject



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

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

.loaderObject



114
115
116
117
118
119
# File 'lib/holidays/factory/definition.rb', line 114

def loader
  Holidays::Definition::Context::Load.new(
    merger,
    Holidays::FULL_DEFINITIONS_PATH,
  )
end

.mergerObject



55
56
57
58
59
60
61
# File 'lib/holidays/factory/definition.rb', line 55

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

.module_generatorObject



121
122
123
# File 'lib/holidays/factory/definition.rb', line 121

def module_generator
  Holidays::Definition::Generator::Module.new
end

.proc_result_cache_repositoryObject



102
103
104
# File 'lib/holidays/factory/definition.rb', line 102

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

.region_validatorObject



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

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

.regions_generatorObject



110
111
112
# File 'lib/holidays/factory/definition.rb', line 110

def regions_generator
  Holidays::Definition::Generator::Regions.new
end

.regions_repositoryObject



91
92
93
94
95
96
# File 'lib/holidays/factory/definition.rb', line 91

def regions_repository
  @regions_repo ||= Holidays::Definition::Repository::Regions.new(
    Holidays::REGIONS,
    Holidays::PARENT_REGION_LOOKUP,
  )
end

.source_generatorObject



37
38
39
40
41
42
43
44
45
46
# File 'lib/holidays/factory/definition.rb', line 37

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

.test_decoratorObject



131
132
133
# File 'lib/holidays/factory/definition.rb', line 131

def test_decorator
  Holidays::Definition::Decorator::Test.new
end

.test_generatorObject



125
126
127
128
129
# File 'lib/holidays/factory/definition.rb', line 125

def test_generator
  Holidays::Definition::Generator::Test.new(
    test_decorator,
  )
end

.test_parserObject



135
136
137
138
139
# File 'lib/holidays/factory/definition.rb', line 135

def test_parser
  Holidays::Definition::Parser::Test.new(
    Holidays::Definition::Validator::Test.new,
  )
end