Module: Holidays::Factory::Definition

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

Class Method Summary collapse

Class Method Details

.cache_repositoryObject


95
96
97
# File 'lib/holidays/factory/definition.rb', line 95

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

.custom_method_parserObject


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

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

.custom_method_proc_decoratorObject


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

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

.custom_method_source_decoratorObject


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

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

.custom_method_validatorObject


80
81
82
# File 'lib/holidays/factory/definition.rb', line 80

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

.custom_methods_repositoryObject


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

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

.file_parserObject


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

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

.function_processorObject


45
46
47
48
49
50
# File 'lib/holidays/factory/definition.rb', line 45

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

.holidays_by_month_repositoryObject


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

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

.loaderObject


111
112
113
114
115
116
# File 'lib/holidays/factory/definition.rb', line 111

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

.mergerObject


52
53
54
55
56
57
58
# File 'lib/holidays/factory/definition.rb', line 52

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

.proc_result_cache_repositoryObject


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

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

.region_validatorObject


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

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

.regions_generatorObject


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

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

.regions_repositoryObject


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

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

.source_generatorObject


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

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

.test_decoratorObject


124
125
126
# File 'lib/holidays/factory/definition.rb', line 124

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

.test_generatorObject


118
119
120
121
122
# File 'lib/holidays/factory/definition.rb', line 118

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

.test_parserObject


128
129
130
131
132
# File 'lib/holidays/factory/definition.rb', line 128

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