class CalendariumRomanum::Temporale::CelebrationFactory

Provides factory methods building {Celebration}s for temporale feasts

Public Class Methods

each() { |public_send(symbol)| ... } click to toggle source

@yield [Symbol] @return [void, Enumerator]

# File lib/calendarium-romanum/temporale/celebration_factory.rb, line 9
def each
  return to_enum(__method__) unless block_given?

  celebrations.each do |symbol|
    yield public_send(symbol)
  end
end
first_advent_sunday() click to toggle source

@return [Celebration]

# File lib/calendarium-romanum/temporale/celebration_factory.rb, line 18
def first_advent_sunday
  Temporale.create_celebration(
    I18n.t('temporale.advent.sunday', week: Ordinalizer.ordinal(1)),
    Ranks::PRIMARY,
    Colours::VIOLET
  )
end

Private Class Methods

celebration(symbol, rank, colour = Colours::WHITE, fixed_date: nil, sunday: nil) click to toggle source
# File lib/calendarium-romanum/temporale/celebration_factory.rb, line 32
def celebration(symbol, rank, colour = Colours::WHITE, fixed_date: nil, sunday: nil)
  define_singleton_method(symbol) do
    Temporale.create_celebration(
      proc { I18n.t("temporale.solemnity.#{symbol}") },
      rank,
      colour,
      symbol: symbol,
      date: fixed_date,
      sunday: sunday
    )
  end

  celebrations << symbol
end
celebrations() click to toggle source
# File lib/calendarium-romanum/temporale/celebration_factory.rb, line 28
def celebrations
  @celebrations ||= [:first_advent_sunday]
end