Module: GouvCalendarCompilator

Defined in:
lib/version.rb,
lib/gouv_calendar_compilator.rb,
lib/gouv_calendar_compilator/data_fetcher.rb,
lib/gouv_calendar_compilator/data_compilator.rb,
lib/gouv_calendar_compilator/zone_department_matching/france.rb,
lib/gouv_calendar_compilator/data_compilators/france/school_holidays_data_compilator.rb,
lib/gouv_calendar_compilator/data_compilators/france/national_days_off_data_compilator.rb

Overview

– Copyright (C) 2021 - Octopus Lab SAS All rights are described by the GPLv3 license present in the file /LICENSE available in the original repository of this file or [here](www.gnu.org/licenses/gpl-3.0.fr.html). ++ frozen_string_literal: true

Defined Under Namespace

Modules: France, ZoneDepartmentMatching Classes: ArgumentError, DataCompilator, DataFetcher, Error

Constant Summary collapse

VERSION =
'1.0.4'
YEAR_START =
2020
YEAR_END =
(::Date.today.year + 1)
SCHOOL_HOLIDAYS_DATA_URL =
'https://www.data.gouv.fr/fr/datasets/r/000ae493-9fa8-4088-9f53-76d375204036'
DAYS_OFF_API_BASE_URL =
'https://calendrier.api.gouv.fr/jours-feries/'
DAYS_OFF_ZONES_MATCHING =
{
  guadeloupe: ['Guadeloupe'],
  guyane: ['Guyane'],
  'la-reunion': ['Réunion'],
  martinique: ['Martinique'],
  mayotte: ['Mayotte'],
  metropole: ['Zone A', 'Zone B', 'Zone C', 'Corse'],
  'nouvelle-caledonie': ['Nouvelle Calédonie'],
  'polynesie-francaise': ['Polynésie'],
  'saint-pierre-et-miquelon': ['Saint Pierre et Miquelon'],
  'wallis-et-futuna': ['Wallis et Futuna']
}.freeze
OPERATING_DAY =
0
SCHOOL_HOLIDAYS =
1
NATIONAL_DAY_OFF =
2
WEEK_END =
3
DATETIME_START =
::Date.parse("#{::GouvCalendarCompilator::YEAR_START}-01-01T00:00:00").freeze
DATETIME_END =
::Date.parse("#{::GouvCalendarCompilator::YEAR_END}-12-31T23:59:59").freeze
ONE_SECOND =
(1.0 / (60 * 24 * 24))