Class: CalendariumRomanum::Rank
- Inherits:
-
Object
- Object
- CalendariumRomanum::Rank
- Includes:
- Comparable
- Defined in:
- lib/calendarium-romanum/rank.rb
Instance Attribute Summary collapse
-
#priority ⇒ Object
(also: #to_f)
readonly
Returns the value of attribute priority.
Instance Method Summary collapse
- #<=>(b) ⇒ Object
- #desc ⇒ Object (also: #to_s)
- #feast? ⇒ Boolean
-
#initialize(priority = nil, desc = nil, short_desc = nil) ⇒ Rank
constructor
A new instance of Rank.
- #memorial? ⇒ Boolean
- #short_desc ⇒ Object
- #solemnity? ⇒ Boolean
Constructor Details
#initialize(priority = nil, desc = nil, short_desc = nil) ⇒ Rank
Returns a new instance of Rank.
5 6 7 8 9 |
# File 'lib/calendarium-romanum/rank.rb', line 5 def initialize(priority=nil, desc=nil, short_desc=nil) @priority = priority @desc = desc @short_desc = short_desc end |
Instance Attribute Details
#priority ⇒ Object (readonly) Also known as: to_f
Returns the value of attribute priority.
11 12 13 |
# File 'lib/calendarium-romanum/rank.rb', line 11 def priority @priority end |
Instance Method Details
#<=>(b) ⇒ Object
24 25 26 |
# File 'lib/calendarium-romanum/rank.rb', line 24 def <=>(b) b.priority <=> self.priority end |
#desc ⇒ Object Also known as: to_s
14 15 16 |
# File 'lib/calendarium-romanum/rank.rb', line 14 def desc @desc && I18n.t(@desc) end |
#feast? ⇒ Boolean
32 33 34 |
# File 'lib/calendarium-romanum/rank.rb', line 32 def feast? priority.to_i == 2 end |
#memorial? ⇒ Boolean
36 37 38 |
# File 'lib/calendarium-romanum/rank.rb', line 36 def memorial? priority.to_i == 3 end |
#short_desc ⇒ Object
20 21 22 |
# File 'lib/calendarium-romanum/rank.rb', line 20 def short_desc @short_desc && I18n.t(@short_desc) end |
#solemnity? ⇒ Boolean
28 29 30 |
# File 'lib/calendarium-romanum/rank.rb', line 28 def solemnity? priority.to_i == 1 end |