Class: MkCalendar::Calendar
- Inherits:
-
Object
- Object
- MkCalendar::Calendar
- Includes:
- Compute
- Defined in:
- lib/mk_calendar/calendar.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#jd ⇒ Object
readonly
Returns the value of attribute jd.
-
#jd_jst ⇒ Object
readonly
Returns the value of attribute jd_jst.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#alpha ⇒ Object
視黄経(月) =========================================================================.
-
#holiday ⇒ Object
休日 =========================================================================.
-
#initialize(ymd) ⇒ Calendar
constructor
A new instance of Calendar.
-
#kanshi ⇒ Object
干支 =========================================================================.
-
#lambda ⇒ Object
視黄経(太陽) =========================================================================.
-
#moonage ⇒ Object
月齢(正午) =========================================================================.
-
#oc ⇒ Object
旧暦 =========================================================================.
-
#sekki_24 ⇒ Object
二十四節気 =========================================================================.
-
#sekku ⇒ Object
節句 =========================================================================.
-
#yobi ⇒ Object
曜日 =========================================================================.
-
#zassetsu ⇒ Object
雑節 =========================================================================.
Methods included from Compute
compute_alpha, compute_dt, compute_holiday, compute_kanshi, compute_lambda, compute_last_nc, compute_moonage, compute_oc, compute_rokuyo, compute_saku, compute_sekki_24, compute_sekku, compute_yobi, compute_zassetsu, gc2jd, jd2ymd, norm_angle
Constructor Details
#initialize(ymd) ⇒ Calendar
Returns a new instance of Calendar.
9 10 11 12 13 |
# File 'lib/mk_calendar/calendar.rb', line 9 def initialize(ymd) @year, @month, @day = ymd @jd = gc2jd(@year, @month, @day) @jd_jst = @jd + Const::JST_D end |
Instance Attribute Details
#day ⇒ Object (readonly)
Returns the value of attribute day.
5 6 7 |
# File 'lib/mk_calendar/calendar.rb', line 5 def day @day end |
#jd ⇒ Object (readonly)
Returns the value of attribute jd.
5 6 7 |
# File 'lib/mk_calendar/calendar.rb', line 5 def jd @jd end |
#jd_jst ⇒ Object (readonly)
Returns the value of attribute jd_jst.
5 6 7 |
# File 'lib/mk_calendar/calendar.rb', line 5 def jd_jst @jd_jst end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
5 6 7 |
# File 'lib/mk_calendar/calendar.rb', line 5 def month @month end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
5 6 7 |
# File 'lib/mk_calendar/calendar.rb', line 5 def year @year end |
Instance Method Details
#alpha ⇒ Object
視黄経(月)
67 68 69 |
# File 'lib/mk_calendar/calendar.rb', line 67 def alpha return compute_alpha(@jd_jst) end |
#holiday ⇒ Object
休日
18 19 20 |
# File 'lib/mk_calendar/calendar.rb', line 18 def holiday return compute_holiday(@year, @month, @day) end |
#kanshi ⇒ Object
干支
46 47 48 |
# File 'lib/mk_calendar/calendar.rb', line 46 def kanshi return compute_kanshi(@jd_jst) end |
#lambda ⇒ Object
視黄経(太陽)
60 61 62 |
# File 'lib/mk_calendar/calendar.rb', line 60 def lambda return compute_lambda(@jd_jst) end |
#moonage ⇒ Object
月齢(正午)
74 75 76 |
# File 'lib/mk_calendar/calendar.rb', line 74 def moonage return compute_moonage(@jd_jst) end |
#oc ⇒ Object
旧暦
81 82 83 |
# File 'lib/mk_calendar/calendar.rb', line 81 def oc return compute_oc(@jd_jst) end |
#sekki_24 ⇒ Object
二十四節気
25 26 27 |
# File 'lib/mk_calendar/calendar.rb', line 25 def sekki_24 return compute_sekki_24(@jd_jst) end |
#sekku ⇒ Object
節句
53 54 55 |
# File 'lib/mk_calendar/calendar.rb', line 53 def sekku return compute_sekku(@month, @day) end |
#yobi ⇒ Object
曜日
39 40 41 |
# File 'lib/mk_calendar/calendar.rb', line 39 def yobi return compute_yobi(@jd_jst) end |
#zassetsu ⇒ Object
雑節
32 33 34 |
# File 'lib/mk_calendar/calendar.rb', line 32 def zassetsu return compute_zassetsu(@jd_jst) end |