Class: BahaiDate::Month
- Inherits:
-
Object
- Object
- BahaiDate::Month
- Defined in:
- lib/bahai_date/month.rb
Constant Summary collapse
- TITLES =
%w(Baha Jalal Jamal Azamat Nur Rahmat Kalimat Kamal Asma Izzat Mashiyyat Ilm Qudrat Qawl Masail Sharaf Sultan Mulk Ala Ayyam-i-Ha)
- TITLES_HTML =
%w(Bahá Jalál Jamál ‘Aẓamat Núr Raḥmat Kalimát Kamál Asmá’ ‘Izzat Ma<u>sh</u>íyyat ‘Ilm Qudrat Qawl Masá’il <u>Sh</u>araf Sulṭán Mulk ‘Alá’ Ayyám-i-Há)
- TITLES_EN =
%w(Splendour Glory Beauty Grandeur Light Mercy Words Perfection Names Might Will Knowledge Power Speech Questions Honour Sovereignty Dominion Loftiness Ayyam-i-Ha)
Instance Attribute Summary collapse
-
#days ⇒ Object
readonly
Returns the value of attribute days.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
- #add_day(day_number) ⇒ Object
- #html ⇒ Object
-
#initialize(number_arg) ⇒ Month
constructor
A new instance of Month.
- #title ⇒ Object
- #to_s ⇒ Object
- #translation ⇒ Object
Constructor Details
#initialize(number_arg) ⇒ Month
Returns a new instance of Month.
9 10 11 12 13 |
# File 'lib/bahai_date/month.rb', line 9 def initialize(number_arg) validate number_arg @number = number_arg.to_i @days = {} end |
Instance Attribute Details
#days ⇒ Object (readonly)
Returns the value of attribute days.
7 8 9 |
# File 'lib/bahai_date/month.rb', line 7 def days @days end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
7 8 9 |
# File 'lib/bahai_date/month.rb', line 7 def number @number end |
Instance Method Details
#add_day(day_number) ⇒ Object
31 32 33 34 |
# File 'lib/bahai_date/month.rb', line 31 def add_day(day_number) return if @days[day_number] @days[day_number] = Day.new(day_number) end |
#html ⇒ Object
27 28 29 |
# File 'lib/bahai_date/month.rb', line 27 def html TITLES_HTML[title_index] end |
#title ⇒ Object
19 20 21 |
# File 'lib/bahai_date/month.rb', line 19 def title TITLES[title_index] end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/bahai_date/month.rb', line 15 def to_s title end |
#translation ⇒ Object
23 24 25 |
# File 'lib/bahai_date/month.rb', line 23 def translation TITLES_EN[title_index] end |