Ruby gem for calendar computations according to the Roman Catholic liturgical calendar as instituted by MP Paschalis[http://w2.vatican.va/content/paul-vi/en/motu_proprio/documents/hf_p-vi_motu-proprio_19690214_mysterii-paschalis.html] of Paul VI. (AAS 61 (1969), pp. 222-226). The rules are defined in Norms for the Liturgical Year and the Calendar[https://www.ewtn.com/catholicism/library/liturgical-year-2193].
For usage instructions with copy-pastable code examples see README
Object model overview
is the library's main functional unit. It represents calendar for a single liturgical year and allows retrieving calendar data for any of the year's days. Calendar basically consists of a and a and it's main task is to combine information from both and for any day of the year produce a fully and correctly populated instance, containing one or more (see ).
Calendar does not own either
Sanctorale - it is possible to pass them on initialization and they are treated as read-only. The only exception is method , which freezes all the
Calendar's contents, including
is a higher-level API for retrieving calendar data without bothering about liturgical years. It builds instances internally and passes method calls to them.
contains complete calendar data of a liturgical day. It owns one or more . If there are multiple it means that any one of them can be chosen and celebrated that day.
represents a celebration (particular solemnity / feast / memorial / Sunday / ferial) and holds it's liturgical properties, encoded mostly by value objects.
Celebration instances are not bound to a particular date, they represent “celebration C in general”, not “celebration C in year Y”. The latter is represented only by a combination of
Celebration instances are immutable and some may be used repeatedly in context of various days and calendars.)
, , are value objects representing values of properties. Immutable instances representing the standard values are referenced by constants and normally there should be no need to create any more.
represents the temporale cycle of a single liturgical year, computes movable feasts, determines liturgical seasons. For any day of the year it provides a temporale .
represents the sanctorale cycle, i.e. the fixed-date celebrations, mostly feasts of saints. It is not bound to a particular year, hence a single instance can be used by many instances representing various liturgical years. For any day it provides zero or more .
Most particular calendars (calendars of countries, provinces, dioceses, churches, religious institutes) share the same temporale definition and differ in sanctorale contents. Therefore the task of implementing a particular calendar usually consists of populating a sanctorale data file and loading it using .instance with the desired data. A convenient way to do so is preparing a