Class: MkCalendar::Calendar

Inherits:
Object
  • Object
show all
Includes:
Compute
Defined in:
lib/mk_calendar/calendar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dayObject (readonly)

Returns the value of attribute day.



5
6
7
# File 'lib/mk_calendar/calendar.rb', line 5

def day
  @day
end

#jdObject (readonly)

Returns the value of attribute jd.



5
6
7
# File 'lib/mk_calendar/calendar.rb', line 5

def jd
  @jd
end

#jd_jstObject (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

#monthObject (readonly)

Returns the value of attribute month.



5
6
7
# File 'lib/mk_calendar/calendar.rb', line 5

def month
  @month
end

#yearObject (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

#alphaObject

視黄経(月)



67
68
69
# File 'lib/mk_calendar/calendar.rb', line 67

def alpha
  return compute_alpha(@jd_jst)
end

#holidayObject

休日



18
19
20
# File 'lib/mk_calendar/calendar.rb', line 18

def holiday
  return compute_holiday(@year, @month, @day)
end

#kanshiObject

干支



46
47
48
# File 'lib/mk_calendar/calendar.rb', line 46

def kanshi
  return compute_kanshi(@jd_jst)
end

#lambdaObject

視黄経(太陽)



60
61
62
# File 'lib/mk_calendar/calendar.rb', line 60

def lambda
  return compute_lambda(@jd_jst)
end

#moonageObject

月齢(正午)



74
75
76
# File 'lib/mk_calendar/calendar.rb', line 74

def moonage
  return compute_moonage(@jd_jst)
end

#ocObject

旧暦



81
82
83
# File 'lib/mk_calendar/calendar.rb', line 81

def oc
  return compute_oc(@jd_jst)
end

#sekki_24Object

二十四節気



25
26
27
# File 'lib/mk_calendar/calendar.rb', line 25

def sekki_24
  return compute_sekki_24(@jd_jst)
end

#sekkuObject

節句



53
54
55
# File 'lib/mk_calendar/calendar.rb', line 53

def sekku
  return compute_sekku(@month, @day)
end

#yobiObject

曜日



39
40
41
# File 'lib/mk_calendar/calendar.rb', line 39

def yobi
  return compute_yobi(@jd_jst)
end

#zassetsuObject

雑節



32
33
34
# File 'lib/mk_calendar/calendar.rb', line 32

def zassetsu
  return compute_zassetsu(@jd_jst)
end