Class: BahaiDate::Weekday

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#numberObject (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_equivalentObject



31
32
33
# File 'lib/bahai_date/weekday.rb', line 31

def english_equivalent
  ENGLISH_EQUIVALENTS[title_index]
end

#htmlObject



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

def html
  TITLES_HTML[title_index]
end

#titleObject



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

def title
  TITLES[title_index]
end

#to_sObject



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

def to_s
  title
end

#translationObject



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

def translation
  TITLES_EN[title_index]
end