Module: Darian::DateMethods
Overview
Common date methods for Time and Date classes.
Instance Attribute Summary collapse
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#month_of_season ⇒ Object
readonly
Returns the value of attribute month_of_season.
-
#season ⇒ Object
readonly
Returns the value of attribute season.
-
#since_epoch ⇒ Object
readonly
Returns the value of attribute since_epoch.
-
#sol ⇒ Object
(also: #day)
readonly
Returns the value of attribute sol.
-
#sol_of_season ⇒ Object
readonly
Returns the value of attribute sol_of_season.
-
#week_sol ⇒ Object
(also: #week_day)
readonly
Returns the value of attribute week_sol.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #<=>(another) ⇒ Object
- #month_name ⇒ Object
- #week_sol_name ⇒ Object (also: #week_day_name)
Instance Attribute Details
#month ⇒ Object (readonly)
Returns the value of attribute month.
28 29 30 |
# File 'lib/darian/date_methods.rb', line 28 def month @month end |
#month_of_season ⇒ Object (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 |
#season ⇒ Object (readonly)
Returns the value of attribute season.
33 34 35 |
# File 'lib/darian/date_methods.rb', line 33 def season @season end |
#since_epoch ⇒ Object (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 |
#sol ⇒ Object (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_season ⇒ Object (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_sol ⇒ Object (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 |
#year ⇒ Object (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_name ⇒ Object
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_name ⇒ Object 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 |