Module: CalendariumRomanum::RankPredicates
- Included in:
- Celebration, Rank
- Defined in:
- lib/calendarium-romanum/rank_predicates.rb
Overview
Mixin providing rank-describing predicates. Expects the including class to have instance method #rank
returning a Rank.
Instance Method Summary collapse
- #feast? ⇒ Boolean
- #ferial? ⇒ Boolean
- #memorial? ⇒ Boolean
- #obligatory_memorial? ⇒ Boolean
- #optional_memorial? ⇒ Boolean
- #solemnity? ⇒ Boolean
- #sunday? ⇒ Boolean
Instance Method Details
#feast? ⇒ Boolean
17 18 19 |
# File 'lib/calendarium-romanum/rank_predicates.rb', line 17 def feast? rank.priority.to_i == 2 end |
#ferial? ⇒ Boolean
38 39 40 41 |
# File 'lib/calendarium-romanum/rank_predicates.rb', line 38 def ferial? rank == Ranks::FERIAL || rank == Ranks::FERIAL_PRIVILEGED end |
#memorial? ⇒ Boolean
22 23 24 |
# File 'lib/calendarium-romanum/rank_predicates.rb', line 22 def memorial? rank.priority.to_i == 3 && rank.priority <= 3.12 end |
#obligatory_memorial? ⇒ Boolean
32 33 34 |
# File 'lib/calendarium-romanum/rank_predicates.rb', line 32 def obligatory_memorial? memorial? && !optional_memorial? end |
#optional_memorial? ⇒ Boolean
27 28 29 |
# File 'lib/calendarium-romanum/rank_predicates.rb', line 27 def optional_memorial? rank == Ranks::MEMORIAL_OPTIONAL end |
#solemnity? ⇒ Boolean
6 7 8 |
# File 'lib/calendarium-romanum/rank_predicates.rb', line 6 def solemnity? rank.priority.to_i == 1 end |
#sunday? ⇒ Boolean
12 13 14 |
# File 'lib/calendarium-romanum/rank_predicates.rb', line 12 def sunday? rank == Ranks::SUNDAY_UNPRIVILEGED end |