Class: CalendariumRomanum::Day

Inherits:
Object
  • Object
show all
Defined in:
lib/calendarium-romanum/day.rb

Overview

information on one particular day of the liturgical year

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#celebrationsObject (readonly)

an Array of Celebrations, possibly empty


28
29
30
# File 'lib/calendarium-romanum/day.rb', line 28

def celebrations
  @celebrations
end

#dateObject (readonly)

Returns the value of attribute date


15
16
17
# File 'lib/calendarium-romanum/day.rb', line 15

def date
  @date
end

#seasonObject (readonly)

one of the Seasons


22
23
24
# File 'lib/calendarium-romanum/day.rb', line 22

def season
  @season
end

#season_weekObject (readonly)

week of the season (Integer)


25
26
27
# File 'lib/calendarium-romanum/day.rb', line 25

def season_week
  @season_week
end

#vespersObject (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?

Returns:

  • (Boolean)

47
48
49
# File 'lib/calendarium-romanum/day.rb', line 47

def vespers_from_following?
  !vespers.nil?
end

#weekdayObject


17
18
19
# File 'lib/calendarium-romanum/day.rb', line 17

def weekday
  date.wday
end