Class: GouvCalendarCompilator::France::SchoolHolidaysDataCompilator
- Inherits:
-
Object
- Object
- GouvCalendarCompilator::France::SchoolHolidaysDataCompilator
- Defined in:
- lib/gouv_calendar_compilator/data_compilators/france/school_holidays_data_compilator.rb
Overview
Manages the compilation of different school holidays data sources and compile them into a new, properly formatted one
Instance Method Summary collapse
-
#compile ⇒ Object
This is the method you want to call to compile the school holidays into a proper dataset.
-
#initialize ⇒ SchoolHolidaysDataCompilator
constructor
Initializer for School Holidays data compiler.
Constructor Details
#initialize ⇒ SchoolHolidaysDataCompilator
Initializer for School Holidays data compiler
14 15 16 |
# File 'lib/gouv_calendar_compilator/data_compilators/france/school_holidays_data_compilator.rb', line 14 def initialize @data_fetcher = ::GouvCalendarCompilator::DataFetcher.new end |
Instance Method Details
#compile ⇒ Object
This is the method you want to call to compile the school holidays into a proper dataset. It returns a ruby Array of Hashes
20 21 22 23 24 25 |
# File 'lib/gouv_calendar_compilator/data_compilators/france/school_holidays_data_compilator.rb', line 20 def compile school_holidays_data_full = @data_fetcher.fetch_school_holidays_data school_holidays_data_trimmed = sh_trim_not_necessary_data(school_holidays_data_full) zones = sh_define_possible_zones(school_holidays_data_trimmed) sh_format_zones_data(school_holidays_data_trimmed, zones, school_holidays_data_full) end |