Class: CalendariumRomanum::Day
- Inherits:
-
Object
- Object
- CalendariumRomanum::Day
- Defined in:
- lib/calendarium-romanum/day.rb
Overview
information on one particular day of the liturgical year
Instance Attribute Summary collapse
-
#celebrations ⇒ Object
readonly
an Array of Celebrations, possibly empty.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#season ⇒ Object
readonly
one of the Seasons.
-
#season_week ⇒ Object
readonly
week of the season (Integer).
-
#vespers ⇒ Object
readonly
nil or Celebration from which first Vespers are celebrated instead of Vespers of the day’s other Celebrations.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(date: nil, season: nil, season_week: nil, celebrations: nil, vespers: nil) ⇒ Day
constructor
A new instance of Day.
-
#vespers_from_following? ⇒ Boolean
Are the day’s Vespers suppressed in favour of first Vespers of a Sunday or solemnity?.
- #weekday ⇒ Object
Constructor Details
#initialize(date: nil, season: nil, season_week: nil, celebrations: nil, vespers: nil) ⇒ Day
Returns a new instance of Day.
7 8 9 10 11 12 13 |
# File 'lib/calendarium-romanum/day.rb', line 7 def initialize(date: nil, season: nil, season_week: nil, celebrations: nil, vespers: nil) @date = date @season = season @season_week = season_week @celebrations = celebrations ? celebrations.dup : [] @vespers = vespers end |
Instance Attribute Details
#celebrations ⇒ Object (readonly)
an Array of Celebrations, possibly empty
28 29 30 |
# File 'lib/calendarium-romanum/day.rb', line 28 def celebrations @celebrations end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
15 16 17 |
# File 'lib/calendarium-romanum/day.rb', line 15 def date @date end |
#season ⇒ Object (readonly)
one of the Seasons
22 23 24 |
# File 'lib/calendarium-romanum/day.rb', line 22 def season @season end |
#season_week ⇒ Object (readonly)
week of the season (Integer)
25 26 27 |
# File 'lib/calendarium-romanum/day.rb', line 25 def season_week @season_week end |
#vespers ⇒ Object (readonly)
nil or Celebration from which first Vespers are celebrated instead of Vespers of the day’s other Celebrations. Please note that Calendar by default *doesn’t* populate Vespers, - it’s an opt-in feature.
34 35 36 |
# File 'lib/calendarium-romanum/day.rb', line 34 def vespers @vespers end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/calendarium-romanum/day.rb', line 36 def ==(other) self.class == other.class && date == other.date && season == other.season && season_week == other.season_week && celebrations == other.celebrations && vespers == other.vespers end |
#vespers_from_following? ⇒ Boolean
Are the day’s Vespers suppressed in favour of first Vespers of a Sunday or solemnity?
47 48 49 |
# File 'lib/calendarium-romanum/day.rb', line 47 def vespers_from_following? !vespers.nil? end |
#weekday ⇒ Object
17 18 19 |
# File 'lib/calendarium-romanum/day.rb', line 17 def weekday date.wday end |