Class: CalendariumRomanum::Celebration
- Inherits:
-
Object
- Object
- CalendariumRomanum::Celebration
- Extended by:
- Forwardable
- Defined in:
- lib/calendarium-romanum/day.rb
Overview
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
-
#colour ⇒ Colour
(also: #color)
readonly
Liturgical colour.
-
#cycle ⇒ :sanctorale, :temporale
readonly
Describes the celebration as belonging either to the temporale or sanctorale cycle.
-
#date ⇒ AbstractDate?
readonly
Usual date of the celebration.
- #rank ⇒ Rank readonly
-
#symbol ⇒ Symbol?
readonly
Symbol uniquely identifying the celebration.
Instance Method Summary collapse
- #==(b) ⇒ Object
-
#change(title: nil, rank: nil, colour: nil, color: nil, symbol: nil, date: nil, cycle: nil) ⇒ Celebration
Build a new instance using the receiver’s attributes for all properties for which (a non-nil) value was not passed.
- #feast? ⇒ Boolean
- #ferial? ⇒ Boolean
-
#initialize(title = '', rank = Ranks::FERIAL, colour = Colours::GREEN, symbol = nil, date = nil, cycle = :sanctorale) ⇒ Celebration
constructor
A new instance of Celebration.
- #memorial? ⇒ Boolean
-
#sanctorale? ⇒ Boolean
Does the celebration belong to the sanctorale cycle?.
- #solemnity? ⇒ Boolean
- #sunday? ⇒ Boolean
-
#temporale? ⇒ Boolean
Does the celebration belong to the temporale cycle?.
-
#title ⇒ String
Feast title/name.
-
#to_s ⇒ String
String representation of the object’s contents (not very pretty, intended mostly for development inspections).
Constructor Details
#initialize(title = '', rank = Ranks::FERIAL, colour = Colours::GREEN, symbol = nil, date = nil, cycle = :sanctorale) ⇒ Celebration
Returns a new instance of Celebration.
126 127 128 129 130 131 132 133 |
# File 'lib/calendarium-romanum/day.rb', line 126 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
#colour ⇒ Colour (readonly) Also known as: color
Liturgical colour
166 167 168 |
# File 'lib/calendarium-romanum/day.rb', line 166 def colour @colour end |
#cycle ⇒ :sanctorale, :temporale (readonly)
Describes the celebration as belonging either to the temporale or sanctorale cycle
191 192 193 |
# File 'lib/calendarium-romanum/day.rb', line 191 def cycle @cycle end |
#date ⇒ AbstractDate? (readonly)
184 185 186 |
# File 'lib/calendarium-romanum/day.rb', line 184 def date @date end |
#rank ⇒ Rank (readonly)
136 137 138 |
# File 'lib/calendarium-romanum/day.rb', line 136 def rank @rank end |
#symbol ⇒ Symbol? (readonly)
Symbol uniquely identifying the celebration
173 174 175 |
# File 'lib/calendarium-romanum/day.rb', line 173 def symbol @symbol end |
Instance Method Details
#==(b) ⇒ Object
193 194 195 196 197 198 199 200 201 |
# File 'lib/calendarium-romanum/day.rb', line 193 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) ⇒ Celebration
Build a new instance using the receiver’s attributes for all properties for which (a non-nil) value was not passed.
224 225 226 227 228 229 230 231 232 233 |
# File 'lib/calendarium-romanum/day.rb', line 224 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 |
#feast? ⇒ Boolean
150 |
# File 'lib/calendarium-romanum/day.rb', line 150 def_delegators :@rank, :solemnity?, :feast?, :memorial?, :sunday?, :ferial? |
#ferial? ⇒ Boolean
150 |
# File 'lib/calendarium-romanum/day.rb', line 150 def_delegators :@rank, :solemnity?, :feast?, :memorial?, :sunday?, :ferial? |
#memorial? ⇒ Boolean
150 |
# File 'lib/calendarium-romanum/day.rb', line 150 def_delegators :@rank, :solemnity?, :feast?, :memorial?, :sunday?, :ferial? |
#sanctorale? ⇒ Boolean
Does the celebration belong to the sanctorale cycle?
215 216 217 |
# File 'lib/calendarium-romanum/day.rb', line 215 def sanctorale? cycle == :sanctorale end |
#solemnity? ⇒ Boolean
150 |
# File 'lib/calendarium-romanum/day.rb', line 150 def_delegators :@rank, :solemnity?, :feast?, :memorial?, :sunday?, :ferial? |
#sunday? ⇒ Boolean
150 |
# File 'lib/calendarium-romanum/day.rb', line 150 def_delegators :@rank, :solemnity?, :feast?, :memorial?, :sunday?, :ferial? |
#temporale? ⇒ Boolean
Does the celebration belong to the temporale cycle?
207 208 209 |
# File 'lib/calendarium-romanum/day.rb', line 207 def temporale? cycle == :temporale end |
#title ⇒ String
Feast title/name
155 156 157 158 159 160 161 |
# File 'lib/calendarium-romanum/day.rb', line 155 def title if @title.respond_to? :call @title.call else @title end end |
#to_s ⇒ String
String representation of the object’s contents (not very pretty, intended mostly for development inspections).
240 241 242 |
# File 'lib/calendarium-romanum/day.rb', line 240 def to_s "#<#{self.class.name} @title=\"#{title}\" @rank=#{rank} @colour=#{colour} symbol=#{symbol.inspect} date=#{date.inspect} cycle=#{cycle.inspect}>" end |