Class: GouvCalendarCompilator::France::SchoolHolidaysDataCompilator

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeSchoolHolidaysDataCompilator

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

#compileObject

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