Module: Darian::DateMethods

Includes:
Comparable
Included in:
Date, Time
Defined in:
lib/darian/date_methods.rb

Overview

Common date methods for Time and Date classes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#monthObject (readonly)

Returns the value of attribute month.



28
29
30
# File 'lib/darian/date_methods.rb', line 28

def month
  @month
end

#month_of_seasonObject (readonly)

Returns the value of attribute month_of_season.



35
36
37
# File 'lib/darian/date_methods.rb', line 35

def month_of_season
  @month_of_season
end

#seasonObject (readonly)

Returns the value of attribute season.



33
34
35
# File 'lib/darian/date_methods.rb', line 33

def season
  @season
end

#since_epochObject (readonly)

Returns the value of attribute since_epoch.



31
32
33
# File 'lib/darian/date_methods.rb', line 31

def since_epoch
  @since_epoch
end

#solObject (readonly) Also known as: day

Returns the value of attribute sol.



29
30
31
# File 'lib/darian/date_methods.rb', line 29

def sol
  @sol
end

#sol_of_seasonObject (readonly)

Returns the value of attribute sol_of_season.



34
35
36
# File 'lib/darian/date_methods.rb', line 34

def sol_of_season
  @sol_of_season
end

#week_solObject (readonly) Also known as: week_day

Returns the value of attribute week_sol.



32
33
34
# File 'lib/darian/date_methods.rb', line 32

def week_sol
  @week_sol
end

#yearObject (readonly)

Returns the value of attribute year.



27
28
29
# File 'lib/darian/date_methods.rb', line 27

def year
  @year
end

Instance Method Details

#<=>(another) ⇒ Object



82
83
84
# File 'lib/darian/date_methods.rb', line 82

def <=>(another)
  since_epoch <=> another.since_epoch
end

#month_nameObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/darian/date_methods.rb', line 40

def month_name
  case @month
    when  1 then 'Sagittarius'
    when  2 then 'Dhanus'
    when  3 then 'Capricornus'
    when  4 then 'Makara'
    when  5 then 'Aquarius'
    when  6 then 'Kumbha'
    when  7 then 'Pisces'
    when  8 then 'Mina'
    when  9 then 'Aries'
    when 10 then 'Mesha'
    when 11 then 'Taurus'
    when 12 then 'Rishabha'
    when 13 then 'Gemini'
    when 14 then 'Mithuna'
    when 15 then 'Cancer'
    when 16 then 'Karka'
    when 17 then 'Leo'
    when 18 then 'Simha'
    when 19 then 'Virgo'
    when 20 then 'Kanya'
    when 21 then 'Libra'
    when 22 then 'Tula'
    when 23 then 'Scorpius'
    when 24 then 'Vrishika'
  end
end

#week_sol_nameObject Also known as: week_day_name



69
70
71
72
73
74
75
76
77
78
79
# File 'lib/darian/date_methods.rb', line 69

def week_sol_name
  case @week_sol
    when 1 then 'Sol Solis'
  	when 2 then 'Sol Lunae'
  	when 3 then 'Sol Martis'
  	when 4 then 'Sol Mercurii'
  	when 5 then 'Sol Jovis'
  	when 6 then 'Sol Veneris'
  	when 7 then 'Sol Saturni'
  end
end