zakuro 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zakuro/calculation/base/multi_gengou.rb +101 -0
- data/lib/zakuro/calculation/base/multi_gengou_roller.rb +218 -0
- data/lib/zakuro/calculation/base/year.rb +107 -0
- data/lib/zakuro/calculation/cycle/abstract_remainder.rb +459 -0
- data/lib/zakuro/calculation/cycle/abstract_solar_term.rb +151 -0
- data/lib/zakuro/calculation/cycle/zodiac.rb +106 -0
- data/lib/zakuro/calculation/monthly/first_day.rb +45 -0
- data/lib/zakuro/calculation/monthly/initialized_month.rb +120 -0
- data/lib/zakuro/calculation/monthly/month.rb +184 -0
- data/lib/zakuro/calculation/monthly/month_label.rb +88 -0
- data/lib/zakuro/calculation/monthly/operated_month.rb +201 -0
- data/lib/zakuro/calculation/range/full_range.rb +210 -0
- data/lib/zakuro/calculation/range/operated_range.rb +134 -0
- data/lib/zakuro/calculation/range/operated_solar_terms.rb +201 -0
- data/lib/zakuro/calculation/range/transfer/western_date_allocation.rb +76 -0
- data/lib/zakuro/calculation/range/transfer/year_boundary.rb +142 -0
- data/lib/zakuro/calculation/specifier/single_day.rb +109 -0
- data/lib/zakuro/calculation/summary/single.rb +129 -0
- data/lib/zakuro/merchant.rb +2 -2
- data/lib/zakuro/output/error.rb +7 -6
- data/lib/zakuro/output/logger.rb +50 -49
- data/lib/zakuro/output/response.rb +145 -144
- data/lib/zakuro/tools/typeof.rb +2 -2
- data/lib/zakuro/version.rb +1 -1
- data/lib/zakuro/version/abstract_version.rb +1 -1
- data/lib/zakuro/version/context.rb +23 -0
- data/lib/zakuro/version/senmyou/cycle/remainder.rb +63 -0
- data/lib/zakuro/version/senmyou/cycle/solar_term.rb +31 -0
- data/lib/zakuro/version/senmyou/monthly/lunar_phase.rb +186 -182
- data/lib/zakuro/version/senmyou/range/annual_range.rb +134 -129
- data/lib/zakuro/version/senmyou/senmyou.rb +10 -4
- data/lib/zakuro/version/senmyou/stella/lunar_orbit.rb +5 -5
- data/lib/zakuro/version/senmyou/stella/solar_average.rb +4 -4
- data/lib/zakuro/version/senmyou/stella/solar_location.rb +27 -27
- data/lib/zakuro/version/senmyou/stella/solar_orbit.rb +2 -2
- data/lib/zakuro/version/senmyou/stella/winter_solstice.rb +4 -4
- data/lib/zakuro/version/version_class_resolver.rb +62 -0
- data/lib/zakuro/version_factory.rb +2 -2
- metadata +24 -22
- data/lib/zakuro/cycle/abstract_remainder.rb +0 -456
- data/lib/zakuro/cycle/zodiac.rb +0 -103
- data/lib/zakuro/version/senmyou/base/era.rb +0 -83
- data/lib/zakuro/version/senmyou/base/multi_gengou.rb +0 -98
- data/lib/zakuro/version/senmyou/base/multi_gengou_roller.rb +0 -217
- data/lib/zakuro/version/senmyou/base/remainder.rb +0 -60
- data/lib/zakuro/version/senmyou/base/solar_term.rb +0 -148
- data/lib/zakuro/version/senmyou/base/year.rb +0 -104
- data/lib/zakuro/version/senmyou/monthly/first_day.rb +0 -44
- data/lib/zakuro/version/senmyou/monthly/initialized_month.rb +0 -119
- data/lib/zakuro/version/senmyou/monthly/month.rb +0 -181
- data/lib/zakuro/version/senmyou/monthly/month_label.rb +0 -87
- data/lib/zakuro/version/senmyou/monthly/operated_month.rb +0 -196
- data/lib/zakuro/version/senmyou/range/full_range.rb +0 -194
- data/lib/zakuro/version/senmyou/range/operated_range.rb +0 -126
- data/lib/zakuro/version/senmyou/range/operated_solar_terms.rb +0 -181
- data/lib/zakuro/version/senmyou/range/western_date_allocation.rb +0 -68
- data/lib/zakuro/version/senmyou/range/year_boundary.rb +0 -138
- data/lib/zakuro/version/senmyou/specifier/single_day_specifier.rb +0 -102
- data/lib/zakuro/version/senmyou/summary/single.rb +0 -125
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../../../output/logger'
|
4
|
-
require_relative '../
|
5
|
-
require_relative '../
|
6
|
-
require_relative '
|
4
|
+
require_relative '../cycle/remainder'
|
5
|
+
require_relative '../cycle/solar_term'
|
6
|
+
require_relative '../../../calculation/monthly/initialized_month'
|
7
7
|
require_relative '../monthly/lunar_phase'
|
8
8
|
require_relative '../stella/solar_orbit'
|
9
9
|
require_relative '../stella/solar_average'
|
@@ -14,146 +14,151 @@ require_relative '../stella/lunar_orbit'
|
|
14
14
|
module Zakuro
|
15
15
|
# :nodoc:
|
16
16
|
module Senmyou
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
#
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
# :nodoc:
|
18
|
+
module Range
|
19
|
+
#
|
20
|
+
# AnnualRange 年間範囲
|
21
|
+
#
|
22
|
+
module AnnualRange
|
23
|
+
# @return [Output::Logger] ロガー
|
24
|
+
LOGGER = Output::Logger.new(location: 'annual_range')
|
25
|
+
|
26
|
+
# :reek:TooManyStatements { max_statements: 6 }
|
27
|
+
|
28
|
+
#
|
29
|
+
# 11月定朔(冬至が含まれる月の1日:補正済)を求める
|
30
|
+
#
|
31
|
+
# @param [Integer] western_year 西暦年
|
32
|
+
#
|
33
|
+
# @return [Remainder] 11月定朔
|
34
|
+
#
|
35
|
+
def self.calc_last_november_1st(western_year:)
|
36
|
+
# 天正閏余
|
37
|
+
winter_solstice_age = \
|
38
|
+
WinterSolstice.calc_moon_age(western_year: western_year)
|
39
|
+
# 11月経朔
|
40
|
+
november_1st = \
|
41
|
+
WinterSolstice.calc_averaged_last_november_1st(western_year: western_year)
|
42
|
+
# 11月定朔
|
43
|
+
|
44
|
+
# 補正
|
45
|
+
correction_value = correction_value_on_last_november_1st(
|
46
|
+
winter_solstice_age: winter_solstice_age,
|
47
|
+
western_year: western_year
|
48
|
+
)
|
25
49
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
#
|
33
|
-
def self.calc_last_november_1st(western_year:)
|
34
|
-
# 天正閏余
|
35
|
-
winter_solstice_age = \
|
36
|
-
WinterSolstice.calc_moon_age(western_year: western_year)
|
37
|
-
# 11月経朔
|
38
|
-
november_1st = \
|
39
|
-
WinterSolstice.calc_averaged_last_november_1st(western_year: western_year)
|
40
|
-
# 11月定朔
|
41
|
-
|
42
|
-
# 補正
|
43
|
-
correction_value = correction_value_on_last_november_1st(
|
44
|
-
winter_solstice_age: winter_solstice_age,
|
45
|
-
western_year: western_year
|
46
|
-
)
|
47
|
-
|
48
|
-
result = november_1st.add(Remainder.new(day: 0, minute: correction_value,
|
49
|
-
second: 0))
|
50
|
-
# 進朔
|
51
|
-
result.up_on_new_moon!
|
52
|
-
result
|
53
|
-
end
|
50
|
+
result = november_1st.add(Cycle::Remainder.new(day: 0, minute: correction_value,
|
51
|
+
second: 0))
|
52
|
+
# 進朔
|
53
|
+
result.up_on_new_moon!
|
54
|
+
result
|
55
|
+
end
|
54
56
|
|
55
|
-
|
57
|
+
# :reek:TooManyStatements { max_statements: 6 }
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
59
|
+
#
|
60
|
+
# 一覧取得する
|
61
|
+
#
|
62
|
+
# * 対象年に対して、前年11月-当年11月までを出力する
|
63
|
+
# * 対象年(西暦)と計算年(元号x年)の紐付けは行わない
|
64
|
+
#
|
65
|
+
# @param [Integer] western_year 西暦年
|
66
|
+
#
|
67
|
+
# @return [Array<Month>] 1年データ
|
68
|
+
#
|
69
|
+
def self.collect_annual_range_after_last_november_1st(western_year:)
|
70
|
+
annual_range = initialized_annual_range(western_year: western_year)
|
69
71
|
|
70
|
-
|
72
|
+
apply_big_and_small_of_the_month(annual_range: annual_range)
|
71
73
|
|
72
|
-
|
73
|
-
|
74
|
+
solar_average = SolarAverage.new(western_year: western_year)
|
75
|
+
solar_average.set(annual_range: annual_range)
|
74
76
|
|
75
|
-
|
76
|
-
|
77
|
+
# 月間隔を取得するためだけの末尾要素を削除
|
78
|
+
annual_range.pop
|
77
79
|
|
78
|
-
|
79
|
-
|
80
|
+
initialize_month_label(annual_range: annual_range)
|
81
|
+
end
|
80
82
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
)
|
94
|
-
solar_term = \
|
95
|
-
SolarLocation.get(
|
96
|
-
solar_term: solar_term
|
83
|
+
#
|
84
|
+
# 11月定朔の補正値を求める
|
85
|
+
#
|
86
|
+
# @param [Remainder] winter_solstice_age 天正閏余
|
87
|
+
# @param [Integer] western_year 西暦年
|
88
|
+
#
|
89
|
+
# @return [Integer] 補正値
|
90
|
+
#
|
91
|
+
def self.correction_value_on_last_november_1st(winter_solstice_age:, western_year:)
|
92
|
+
# 補正
|
93
|
+
solar_term = Cycle::SolarTerm.new(
|
94
|
+
remainder: winter_solstice_age
|
97
95
|
)
|
96
|
+
solar_term = \
|
97
|
+
SolarLocation.get(
|
98
|
+
solar_term: solar_term
|
99
|
+
)
|
98
100
|
|
99
|
-
|
100
|
-
|
101
|
-
)
|
102
|
-
|
103
|
-
SolarOrbit.calc_sun_orbit_value(solar_term: solar_term) +
|
104
|
-
LunarOrbit.calc_moon_orbit_value(remainder_month: moon_remainder,
|
105
|
-
is_forward: is_forward)
|
106
|
-
end
|
107
|
-
private_class_method :correction_value_on_last_november_1st
|
108
|
-
|
109
|
-
#
|
110
|
-
# 1年データを取得する
|
111
|
-
#
|
112
|
-
# @param [Integer] western_year 西暦年
|
113
|
-
#
|
114
|
-
# @return [Array<Month>] 1年データ
|
115
|
-
#
|
116
|
-
def self.initialized_annual_range(western_year:)
|
117
|
-
result = []
|
118
|
-
lunar_phase = LunarPhase.new(western_year: western_year)
|
119
|
-
|
120
|
-
# 14ヶ月分を生成する(閏年で最大13ヶ月 + 末月の大小/二十四節気を求めるために必要な月)
|
121
|
-
(0..13).each do |_index|
|
122
|
-
adjusted = lunar_phase.next_month
|
123
|
-
|
124
|
-
result.push(
|
125
|
-
InitializedMonth.new(month_label: MonthLabel.new,
|
126
|
-
first_day: FirstDay.new(remainder: adjusted),
|
127
|
-
phase_index: 0)
|
101
|
+
moon_remainder, is_forward = LunarOrbit.calc_moon_point(
|
102
|
+
remainder: winter_solstice_age, western_year: western_year
|
128
103
|
)
|
129
|
-
end
|
130
104
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
#
|
136
|
-
# 1年データの各月に月の大小を設定する
|
137
|
-
#
|
138
|
-
# @param [Array<Month>] annual_range 1年データ
|
139
|
-
#
|
140
|
-
def self.apply_big_and_small_of_the_month(annual_range:)
|
141
|
-
# NOTE: 最後の月は処理できない(=計算外の余分な月が最後に必要である)
|
142
|
-
annual_range.each_cons(2) do |(current_month, next_month)|
|
143
|
-
current_month.eval_many_days(next_month_day: next_month.remainder.day)
|
105
|
+
SolarOrbit.calc_sun_orbit_value(solar_term: solar_term) +
|
106
|
+
LunarOrbit.calc_moon_orbit_value(remainder_month: moon_remainder,
|
107
|
+
is_forward: is_forward)
|
144
108
|
end
|
109
|
+
private_class_method :correction_value_on_last_november_1st
|
110
|
+
|
111
|
+
#
|
112
|
+
# 1年データを取得する
|
113
|
+
#
|
114
|
+
# @param [Integer] western_year 西暦年
|
115
|
+
#
|
116
|
+
# @return [Array<Month>] 1年データ
|
117
|
+
#
|
118
|
+
def self.initialized_annual_range(western_year:)
|
119
|
+
result = []
|
120
|
+
lunar_phase = Monthly::LunarPhase.new(western_year: western_year)
|
121
|
+
|
122
|
+
# 14ヶ月分を生成する(閏年で最大13ヶ月 + 末月の大小/二十四節気を求めるために必要な月)
|
123
|
+
(0..13).each do |_index|
|
124
|
+
adjusted = lunar_phase.next_month
|
125
|
+
|
126
|
+
result.push(
|
127
|
+
Calculation::Monthly::InitializedMonth.new(
|
128
|
+
month_label: Calculation::Monthly::MonthLabel.new,
|
129
|
+
first_day: Calculation::Monthly::FirstDay.new(remainder: adjusted),
|
130
|
+
phase_index: 0
|
131
|
+
)
|
132
|
+
)
|
133
|
+
end
|
134
|
+
|
135
|
+
result
|
136
|
+
end
|
137
|
+
private_class_method :initialized_annual_range
|
138
|
+
|
139
|
+
#
|
140
|
+
# 1年データの各月に月の大小を設定する
|
141
|
+
#
|
142
|
+
# @param [Array<Month>] annual_range 1年データ
|
143
|
+
#
|
144
|
+
def self.apply_big_and_small_of_the_month(annual_range:)
|
145
|
+
# NOTE: 最後の月は処理できない(=計算外の余分な月が最後に必要である)
|
146
|
+
annual_range.each_cons(2) do |(current_month, next_month)|
|
147
|
+
current_month.eval_many_days(next_month_day: next_month.remainder.day)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
private_class_method :apply_big_and_small_of_the_month
|
151
|
+
|
152
|
+
#
|
153
|
+
# 月表示情報を更新する
|
154
|
+
#
|
155
|
+
# @param [Array<Month>] annual_range 1年データ
|
156
|
+
#
|
157
|
+
def self.initialize_month_label(annual_range:)
|
158
|
+
annual_range.each(&:rename_month_label_by_solar_term)
|
159
|
+
end
|
160
|
+
private_class_method :initialize_month_label
|
145
161
|
end
|
146
|
-
private_class_method :apply_big_and_small_of_the_month
|
147
|
-
|
148
|
-
#
|
149
|
-
# 月表示情報を更新する
|
150
|
-
#
|
151
|
-
# @param [Array<Month>] annual_range 1年データ
|
152
|
-
#
|
153
|
-
def self.initialize_month_label(annual_range:)
|
154
|
-
annual_range.each(&:rename_month_label_by_solar_term)
|
155
|
-
end
|
156
|
-
private_class_method :initialize_month_label
|
157
162
|
end
|
158
163
|
end
|
159
164
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'date'
|
4
|
-
require_relative '../abstract_version'
|
5
4
|
require_relative '../../era/western'
|
6
|
-
require_relative '
|
5
|
+
require_relative '../abstract_version'
|
6
|
+
require_relative '../context'
|
7
|
+
require_relative '../../calculation/summary/single'
|
7
8
|
|
8
9
|
# :nodoc:
|
9
10
|
module Zakuro
|
@@ -18,16 +19,21 @@ module Zakuro
|
|
18
19
|
# @return [True] リリースあり
|
19
20
|
RELEASE = true
|
20
21
|
|
22
|
+
# @return [String] 暦クラス名
|
23
|
+
VERSION_NAME = 'Senmyou'
|
24
|
+
|
21
25
|
#
|
22
26
|
# 西暦日から和暦日に変換する
|
23
27
|
#
|
24
28
|
# @param [Date] western_date 西暦日
|
25
29
|
#
|
26
|
-
# @return [Result::
|
30
|
+
# @return [Result::Single] 和暦日
|
27
31
|
#
|
28
32
|
def self.to_japan_date(western_date:)
|
29
33
|
date = Western::Calendar.create(date: western_date)
|
30
|
-
|
34
|
+
|
35
|
+
context = Context.new(version_name: VERSION_NAME)
|
36
|
+
Calculation::Summary::Single.get(context: context, date: date)
|
31
37
|
end
|
32
38
|
end
|
33
39
|
end
|
@@ -13,7 +13,7 @@ module Zakuro
|
|
13
13
|
# @return [Integer] 暦中日
|
14
14
|
# @note ANOMALISTIC_MONTH の半分に相当する
|
15
15
|
HALF_ANOMALISTIC_MONTH = \
|
16
|
-
LunarRemainder.new(day: 13, minute: 6529, second: 9.5)
|
16
|
+
Cycle::LunarRemainder.new(day: 13, minute: 6529, second: 9.5)
|
17
17
|
|
18
18
|
#
|
19
19
|
# Adjustment 補正値情報
|
@@ -122,7 +122,7 @@ module Zakuro
|
|
122
122
|
# @return [True] 正しくない
|
123
123
|
#
|
124
124
|
def self.valid?(remainder:)
|
125
|
-
return if remainder.is_a?(LunarRemainder)
|
125
|
+
return if remainder.is_a?(Cycle::LunarRemainder)
|
126
126
|
|
127
127
|
raise ArgumentError, "unmatch parameter type: #{remainder.class}"
|
128
128
|
end
|
@@ -272,14 +272,14 @@ module Zakuro
|
|
272
272
|
total_year * WinterSolstice::YEAR - winter_solstice_age.to_minute
|
273
273
|
|
274
274
|
remainder_month = \
|
275
|
-
LunarRemainder.new(total: (total_day % ANOMALISTIC_MONTH))
|
275
|
+
Cycle::LunarRemainder.new(total: (total_day % ANOMALISTIC_MONTH))
|
276
276
|
|
277
277
|
remainder_month, is_forward = decrease_moon_point(
|
278
278
|
remainder_month: remainder_month,
|
279
279
|
remainder_limit: HALF_ANOMALISTIC_MONTH, is_forward: true
|
280
280
|
)
|
281
281
|
|
282
|
-
remainder_month.add!(Remainder.new(day: 1, minute: 0, second: 0))
|
282
|
+
remainder_month.add!(Cycle::Remainder.new(day: 1, minute: 0, second: 0))
|
283
283
|
|
284
284
|
[remainder_month, is_forward]
|
285
285
|
end
|
@@ -302,7 +302,7 @@ module Zakuro
|
|
302
302
|
remainder_month, is_forward = \
|
303
303
|
decrease_moon_point(
|
304
304
|
remainder_month: remainder,
|
305
|
-
remainder_limit: Remainder.new(day: 14, minute: 6529, second: 0),
|
305
|
+
remainder_limit: Cycle::Remainder.new(day: 14, minute: 6529, second: 0),
|
306
306
|
is_forward: is_forward
|
307
307
|
)
|
308
308
|
|
@@ -9,7 +9,7 @@ module Zakuro
|
|
9
9
|
#
|
10
10
|
class SolarAverage
|
11
11
|
# @return [Remainder] 気策(24分の1年)
|
12
|
-
SOLAR_TERM_AVERAGE = Remainder.new(day: 15, minute: 1835, second: 5)
|
12
|
+
SOLAR_TERM_AVERAGE = Cycle::Remainder.new(day: 15, minute: 1835, second: 5)
|
13
13
|
|
14
14
|
#
|
15
15
|
# 初期化
|
@@ -52,7 +52,7 @@ module Zakuro
|
|
52
52
|
winter_solstice = WinterSolstice.calc(western_year: western_year)
|
53
53
|
|
54
54
|
# 二十四節気(冬至)
|
55
|
-
solar_term = SolarTerm.new(index: 0, remainder: winter_solstice)
|
55
|
+
solar_term = Cycle::SolarTerm.new(index: 0, remainder: winter_solstice)
|
56
56
|
|
57
57
|
first_solar_term_index = SolarAverage.calc_fist_solar_term_index(western_year: western_year)
|
58
58
|
|
@@ -81,13 +81,13 @@ module Zakuro
|
|
81
81
|
|
82
82
|
# 入定気を求める
|
83
83
|
solar_location = SolarLocation.get(
|
84
|
-
solar_term: SolarTerm.new(remainder: winter_solstice_age)
|
84
|
+
solar_term: Cycle::SolarTerm.new(remainder: winter_solstice_age)
|
85
85
|
)
|
86
86
|
|
87
87
|
solar_term_index = solar_location.index
|
88
88
|
|
89
89
|
# 入定気の一つ後の二十四節気まで戻す(ただし11月経朔が二十四節気上にある場合は戻さない)
|
90
|
-
solar_term_index += 1 unless solar_location.remainder == Remainder.new(total: 0)
|
90
|
+
solar_term_index += 1 unless solar_location.remainder == Cycle::Remainder.new(total: 0)
|
91
91
|
|
92
92
|
solar_term_index
|
93
93
|
end
|
@@ -17,41 +17,41 @@ module Zakuro
|
|
17
17
|
# @return [Hash<Symbol, Remainder>] 一覧
|
18
18
|
LIST = {
|
19
19
|
# 冬至(とうじ)・大雪(たいせつ)
|
20
|
-
touji: Remainder.new(day: 14, minute: 4235, second: 5),
|
21
|
-
taisetsu: Remainder.new(day: 14, minute: 4235, second: 5),
|
20
|
+
touji: Cycle::Remainder.new(day: 14, minute: 4235, second: 5),
|
21
|
+
taisetsu: Cycle::Remainder.new(day: 14, minute: 4235, second: 5),
|
22
22
|
# 小寒(しょうかん)・小雪(しょうせつ)
|
23
|
-
shoukan: Remainder.new(day: 14, minute: 5235, second: 5),
|
24
|
-
shousetsu: Remainder.new(day: 14, minute: 5235, second: 5),
|
23
|
+
shoukan: Cycle::Remainder.new(day: 14, minute: 5235, second: 5),
|
24
|
+
shousetsu: Cycle::Remainder.new(day: 14, minute: 5235, second: 5),
|
25
25
|
# 大寒(だいかん)・立冬(りっとう)
|
26
|
-
daikan: Remainder.new(day: 14, minute: 6235, second: 5),
|
27
|
-
rittou: Remainder.new(day: 14, minute: 6235, second: 5),
|
26
|
+
daikan: Cycle::Remainder.new(day: 14, minute: 6235, second: 5),
|
27
|
+
rittou: Cycle::Remainder.new(day: 14, minute: 6235, second: 5),
|
28
28
|
# 立春(りっしゅん)・霜降(そうこう)
|
29
|
-
risshun: Remainder.new(day: 14, minute: 7235, second: 5),
|
30
|
-
soukou: Remainder.new(day: 14, minute: 7235, second: 5),
|
29
|
+
risshun: Cycle::Remainder.new(day: 14, minute: 7235, second: 5),
|
30
|
+
soukou: Cycle::Remainder.new(day: 14, minute: 7235, second: 5),
|
31
31
|
# 雨水(うすい)・寒露(かんろ)
|
32
|
-
usui: Remainder.new(day: 15, minute: 35, second: 5),
|
33
|
-
kanro: Remainder.new(day: 15, minute: 35, second: 5),
|
32
|
+
usui: Cycle::Remainder.new(day: 15, minute: 35, second: 5),
|
33
|
+
kanro: Cycle::Remainder.new(day: 15, minute: 35, second: 5),
|
34
34
|
# 啓蟄(けいちつ)・秋分(しゅうぶん)
|
35
|
-
keichitsu: Remainder.new(day: 15, minute: 1235, second: 5),
|
36
|
-
shuubun: Remainder.new(day: 15, minute: 1235, second: 5),
|
35
|
+
keichitsu: Cycle::Remainder.new(day: 15, minute: 1235, second: 5),
|
36
|
+
shuubun: Cycle::Remainder.new(day: 15, minute: 1235, second: 5),
|
37
37
|
# 春分(しゅんぶん)・白露(はくろ)
|
38
|
-
shunbun: Remainder.new(day: 15, minute: 2435, second: 5),
|
39
|
-
hakuro: Remainder.new(day: 15, minute: 2435, second: 5),
|
38
|
+
shunbun: Cycle::Remainder.new(day: 15, minute: 2435, second: 5),
|
39
|
+
hakuro: Cycle::Remainder.new(day: 15, minute: 2435, second: 5),
|
40
40
|
# 清明(せいめい)・処暑(しょしょ)
|
41
|
-
seimei: Remainder.new(day: 15, minute: 3635, second: 5),
|
42
|
-
shosho: Remainder.new(day: 15, minute: 3635, second: 5),
|
41
|
+
seimei: Cycle::Remainder.new(day: 15, minute: 3635, second: 5),
|
42
|
+
shosho: Cycle::Remainder.new(day: 15, minute: 3635, second: 5),
|
43
43
|
# 穀雨(こくう)・立秋(りっしゅう)
|
44
|
-
kokuu: Remainder.new(day: 15, minute: 4835, second: 5),
|
45
|
-
risshuu: Remainder.new(day: 15, minute: 4835, second: 5),
|
44
|
+
kokuu: Cycle::Remainder.new(day: 15, minute: 4835, second: 5),
|
45
|
+
risshuu: Cycle::Remainder.new(day: 15, minute: 4835, second: 5),
|
46
46
|
# 立夏(りっか)・大暑(たいしょ)
|
47
|
-
rikka: Remainder.new(day: 15, minute: 5835, second: 5),
|
48
|
-
taisho: Remainder.new(day: 15, minute: 5835, second: 5),
|
47
|
+
rikka: Cycle::Remainder.new(day: 15, minute: 5835, second: 5),
|
48
|
+
taisho: Cycle::Remainder.new(day: 15, minute: 5835, second: 5),
|
49
49
|
# 小満(しょうまん)・小暑(しょうしょ)
|
50
|
-
shouman: Remainder.new(day: 15, minute: 6835, second: 5),
|
51
|
-
shousho: Remainder.new(day: 15, minute: 6835, second: 5),
|
50
|
+
shouman: Cycle::Remainder.new(day: 15, minute: 6835, second: 5),
|
51
|
+
shousho: Cycle::Remainder.new(day: 15, minute: 6835, second: 5),
|
52
52
|
# 芒種(ぼうしゅ)・夏至(げし)
|
53
|
-
boushu: Remainder.new(day: 15, minute: 7835, second: 5),
|
54
|
-
geshi: Remainder.new(day: 15, minute: 7835, second: 5)
|
53
|
+
boushu: Cycle::Remainder.new(day: 15, minute: 7835, second: 5),
|
54
|
+
geshi: Cycle::Remainder.new(day: 15, minute: 7835, second: 5)
|
55
55
|
}.freeze
|
56
56
|
|
57
57
|
# @return [Array<Remainder>] 索引
|
@@ -171,14 +171,14 @@ module Zakuro
|
|
171
171
|
interval = Interval::INDEXES[index]
|
172
172
|
if winter_solstice_age > interval
|
173
173
|
# 入定気が確定しない(さらに前の定気まで遡れる)
|
174
|
-
return SolarTerm.new(
|
174
|
+
return Cycle::SolarTerm.new(
|
175
175
|
remainder: winter_solstice_age.sub(interval),
|
176
176
|
index: -1
|
177
177
|
)
|
178
178
|
end
|
179
179
|
|
180
180
|
# 入定気が確定する
|
181
|
-
SolarTerm.new(
|
181
|
+
Cycle::SolarTerm.new(
|
182
182
|
remainder: interval.sub(winter_solstice_age),
|
183
183
|
index: index
|
184
184
|
)
|
@@ -204,7 +204,7 @@ module Zakuro
|
|
204
204
|
index += 1
|
205
205
|
index = 0 if index >= Interval::INDEXES.size
|
206
206
|
calc_next_solar_term_recursively(
|
207
|
-
solar_term: SolarTerm.new(remainder: remainder, index: index)
|
207
|
+
solar_term: Cycle::SolarTerm.new(remainder: remainder, index: index)
|
208
208
|
)
|
209
209
|
end
|
210
210
|
private_class_method :calc_next_solar_term_recursively
|