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

Instance Method Details

#feast?Boolean

Returns:

  • (Boolean)


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

def feast?
  rank.priority.to_i == 2
end

#ferial?Boolean

Returns:

  • (Boolean)

Since:

  • 0.6.0



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

Returns:

  • (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

Returns:

  • (Boolean)


32
33
34
# File 'lib/calendarium-romanum/rank_predicates.rb', line 32

def obligatory_memorial?
  memorial? && !optional_memorial?
end

#optional_memorial?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/calendarium-romanum/rank_predicates.rb', line 27

def optional_memorial?
  rank == Ranks::MEMORIAL_OPTIONAL
end

#solemnity?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/calendarium-romanum/rank_predicates.rb', line 6

def solemnity?
  rank.priority.to_i == 1
end

#sunday?Boolean

Returns:

  • (Boolean)

Since:

  • 0.6.0



12
13
14
# File 'lib/calendarium-romanum/rank_predicates.rb', line 12

def sunday?
  rank == Ranks::SUNDAY_UNPRIVILEGED
end