Class: CalendariumRomanum::Celebration

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

Overview

information on one particular celebration of the liturgical year (like a Sunday, feast or memorial); some days have one, some have more among which one is to be chosen

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title = '', rank = Ranks::FERIAL, colour = Colours::GREEN, symbol = nil, date = nil, cycle = :sanctorale) ⇒ Celebration

Returns a new instance of Celebration.


59
60
61
62
63
64
65
66
# File 'lib/calendarium-romanum/day.rb', line 59

def initialize(title = '', rank = Ranks::FERIAL, colour = Colours::GREEN, symbol = nil, date = nil, cycle = :sanctorale)
  @title = title
  @rank = rank
  @colour = colour
  @symbol = symbol
  @date = date
  @cycle = cycle
end

Instance Attribute Details

#colourObject (readonly) Also known as: color

Colour instance (always set) - liturgical colour


82
83
84
# File 'lib/calendarium-romanum/day.rb', line 82

def colour
  @colour
end

#cycleObject (readonly)

Symbol :temporale|:sanctorale Describes the celebration as belonging either to the temporale or sanctorale cycle


95
96
97
# File 'lib/calendarium-romanum/day.rb', line 95

def cycle
  @cycle
end

#dateObject (readonly)

AbstractDate instance - usual date of the celebration. Only set for celebrations with fixed date.


90
91
92
# File 'lib/calendarium-romanum/day.rb', line 90

def date
  @date
end

#rankObject (readonly)

Rank instance


69
70
71
# File 'lib/calendarium-romanum/day.rb', line 69

def rank
  @rank
end

#symbolObject (readonly)

Symbol uniquely identifying the celebration (may be nil)


86
87
88
# File 'lib/calendarium-romanum/day.rb', line 86

def symbol
  @symbol
end

Instance Method Details

#==(b) ⇒ Object


97
98
99
100
101
102
103
104
105
# File 'lib/calendarium-romanum/day.rb', line 97

def ==(b)
  self.class == b.class &&
    title == b.title &&
    rank == b.rank &&
    colour == b.colour &&
    symbol == b.symbol &&
    date == b.date &&
    cycle == b.cycle
end

#change(title: nil, rank: nil, colour: nil, color: nil, symbol: nil, date: nil, cycle: nil) ⇒ Object


115
116
117
118
119
120
121
122
123
124
# File 'lib/calendarium-romanum/day.rb', line 115

def change(title: nil, rank: nil, colour: nil, color: nil, symbol: nil, date: nil, cycle: nil)
  self.class.new(
    title || self.title,
    rank || self.rank,
    colour || color || self.colour,
    symbol || self.symbol,
    date || self.date,
    cycle || self.cycle,
  )
end

#sanctorale?Boolean

Returns:

  • (Boolean)

111
112
113
# File 'lib/calendarium-romanum/day.rb', line 111

def sanctorale?
  cycle == :sanctorale
end

#temporale?Boolean

Returns:

  • (Boolean)

107
108
109
# File 'lib/calendarium-romanum/day.rb', line 107

def temporale?
  cycle == :temporale
end

#titleObject


73
74
75
76
77
78
79
# File 'lib/calendarium-romanum/day.rb', line 73

def title
  if @title.respond_to? :call
    @title.call
  else
    @title
  end
end