Class: BahaiDate::Weekday
- Inherits:
-
Object
- Object
- BahaiDate::Weekday
- Defined in:
- lib/bahai_date/weekday.rb
Constant Summary collapse
- TITLES =
%w(Jalal Jamal Kamal Fidal Idal Istijlal Istiqlal)
- TITLES_HTML =
%w(Jalál Jamál Kamál Fiḍál ‘Idál Istijlál Istiqlál)
- TITLES_EN =
%w(Glory Beauty Perfection Grace Justice Majesty Independence)
- ENGLISH_EQUIVALENTS =
%w(Saturday Sunday Monday Tuesday Wednesday Thursday Friday)
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
- #english_equivalent ⇒ Object
- #html ⇒ Object
-
#initialize(number_arg) ⇒ Weekday
constructor
A new instance of Weekday.
- #title ⇒ Object
- #to_s ⇒ Object
- #translation ⇒ Object
Constructor Details
#initialize(number_arg) ⇒ Weekday
Returns a new instance of Weekday.
10 11 12 13 |
# File 'lib/bahai_date/weekday.rb', line 10 def initialize(number_arg) validate number_arg @number = number_arg.to_i end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
8 9 10 |
# File 'lib/bahai_date/weekday.rb', line 8 def number @number end |
Instance Method Details
#english_equivalent ⇒ Object
31 32 33 |
# File 'lib/bahai_date/weekday.rb', line 31 def english_equivalent ENGLISH_EQUIVALENTS[title_index] end |
#html ⇒ Object
27 28 29 |
# File 'lib/bahai_date/weekday.rb', line 27 def html TITLES_HTML[title_index] end |
#title ⇒ Object
19 20 21 |
# File 'lib/bahai_date/weekday.rb', line 19 def title TITLES[title_index] end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/bahai_date/weekday.rb', line 15 def to_s title end |
#translation ⇒ Object
23 24 25 |
# File 'lib/bahai_date/weekday.rb', line 23 def translation TITLES_EN[title_index] end |