Class: BahaiDate::Day

Inherits:
Object
  • Object
show all
Defined in:
lib/bahai_date/day.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)
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á’)
TITLES_EN =
%w(Splendour Glory Beauty Grandeur Light Mercy Words Perfection Names Might Will Knowledge Power Speech Questions Honour Sovereignty Dominion Loftiness)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number_arg) ⇒ Day

Returns a new instance of Day.



10
11
12
13
# File 'lib/bahai_date/day.rb', line 10

def initialize(number_arg)
  validate number_arg
  @number = number_arg.to_i
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



7
8
9
# File 'lib/bahai_date/day.rb', line 7

def number
  @number
end

#occasionsObject

Returns the value of attribute occasions.



8
9
10
# File 'lib/bahai_date/day.rb', line 8

def occasions
  @occasions
end

#weekdayObject

Returns the value of attribute weekday.



8
9
10
# File 'lib/bahai_date/day.rb', line 8

def weekday
  @weekday
end

Instance Method Details

#htmlObject



27
28
29
# File 'lib/bahai_date/day.rb', line 27

def html
  TITLES_HTML[title_index]
end

#titleObject



19
20
21
# File 'lib/bahai_date/day.rb', line 19

def title
  TITLES[title_index]
end

#to_sObject



15
16
17
# File 'lib/bahai_date/day.rb', line 15

def to_s
  title
end

#translationObject



23
24
25
# File 'lib/bahai_date/day.rb', line 23

def translation
  TITLES_EN[title_index]
end