zakuro 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -13
  3. data/VERSION +1 -1
  4. data/doc/dropped_date.md +93 -0
  5. data/doc/error.md +45 -0
  6. data/doc/operation/csv/month.csv +100 -79
  7. data/doc/operation/operation.xlsx +0 -0
  8. data/lib/zakuro/calculation/base/day.rb +52 -0
  9. data/lib/zakuro/calculation/base/gengou.rb +5 -5
  10. data/lib/zakuro/calculation/base/linear_gengou.rb +5 -5
  11. data/lib/zakuro/calculation/base/operated_year.rb +26 -24
  12. data/lib/zakuro/calculation/base/year.rb +7 -7
  13. data/lib/zakuro/calculation/cycle/abstract_remainder.rb +55 -47
  14. data/lib/zakuro/calculation/cycle/abstract_solar_term.rb +28 -24
  15. data/lib/zakuro/calculation/cycle/zodiac.rb +22 -20
  16. data/lib/zakuro/calculation/era/gengou/abstract_scroll.rb +38 -29
  17. data/lib/zakuro/calculation/era/gengou/internal/connector.rb +4 -4
  18. data/lib/zakuro/calculation/era/gengou/internal/counter.rb +16 -16
  19. data/lib/zakuro/calculation/era/gengou/internal/publisher.rb +74 -72
  20. data/lib/zakuro/calculation/era/gengou/internal/reserve/abstract_list.rb +16 -16
  21. data/lib/zakuro/calculation/era/gengou/internal/reserve/abstract_range.rb +58 -35
  22. data/lib/zakuro/calculation/era/gengou/internal/reserve/dated_list.rb +3 -3
  23. data/lib/zakuro/calculation/era/gengou/internal/reserve/empty_link.rb +111 -113
  24. data/lib/zakuro/calculation/era/gengou/internal/reserve/named_list.rb +6 -6
  25. data/lib/zakuro/calculation/era/gengou/internal/reserve/named_range.rb +7 -9
  26. data/lib/zakuro/calculation/era/gengou/internal/reserve.rb +22 -20
  27. data/lib/zakuro/calculation/era/version/internal/crawler.rb +39 -22
  28. data/lib/zakuro/calculation/era/version/version.rb +12 -10
  29. data/lib/zakuro/calculation/monthly/abstract_lunar_phase.rb +13 -9
  30. data/lib/zakuro/calculation/monthly/const.rb +18 -0
  31. data/lib/zakuro/calculation/monthly/initialized_month.rb +40 -38
  32. data/lib/zakuro/calculation/monthly/month.rb +17 -17
  33. data/lib/zakuro/calculation/monthly/month_label.rb +4 -4
  34. data/lib/zakuro/calculation/monthly/operated_month.rb +37 -86
  35. data/lib/zakuro/calculation/monthly/operated_solar_term.rb +80 -0
  36. data/lib/zakuro/calculation/option/dropped_date/abstract_parameter.rb +44 -0
  37. data/lib/zakuro/calculation/option/dropped_date/location.rb +135 -0
  38. data/lib/zakuro/calculation/range/abstract_full_range.rb +40 -25
  39. data/lib/zakuro/calculation/range/abstract_operation_range.rb +111 -109
  40. data/lib/zakuro/calculation/range/dated_full_range.rb +1 -1
  41. data/lib/zakuro/calculation/range/dated_operation_range.rb +1 -1
  42. data/lib/zakuro/calculation/range/medieval_annual_range.rb +64 -63
  43. data/lib/zakuro/calculation/range/named_full_range.rb +1 -1
  44. data/lib/zakuro/calculation/range/named_operation_range.rb +1 -1
  45. data/lib/zakuro/calculation/range/operated_solar_term.rb +220 -0
  46. data/lib/zakuro/calculation/range/transfer/gengou_scroller.rb +32 -29
  47. data/lib/zakuro/calculation/range/transfer/year_boundary.rb +115 -117
  48. data/lib/zakuro/calculation/stella/lunar/abstract_location.rb +1 -1
  49. data/lib/zakuro/calculation/stella/lunar/choukei_value.rb +48 -46
  50. data/lib/zakuro/calculation/stella/solar/abstract_average.rb +31 -26
  51. data/lib/zakuro/calculation/stella/solar/abstract_location.rb +7 -5
  52. data/lib/zakuro/calculation/stella/solar/choukei_value.rb +114 -114
  53. data/lib/zakuro/calculation/summary/internal/day.rb +42 -0
  54. data/lib/zakuro/calculation/summary/internal/month.rb +32 -11
  55. data/lib/zakuro/calculation/summary/internal/operation.rb +68 -67
  56. data/lib/zakuro/calculation/summary/internal/option.rb +101 -0
  57. data/lib/zakuro/calculation/summary/japan/range.rb +145 -118
  58. data/lib/zakuro/calculation/summary/japan/single.rb +87 -87
  59. data/lib/zakuro/calculation/summary/japan/specifier/single_day.rb +57 -50
  60. data/lib/zakuro/calculation/summary/japan/specifier/specified_range.rb +34 -0
  61. data/lib/zakuro/calculation/summary/western/range.rb +95 -92
  62. data/lib/zakuro/calculation/summary/western/single.rb +78 -76
  63. data/lib/zakuro/calculation/summary/western/specifier/multiple_day.rb +123 -119
  64. data/lib/zakuro/calculation/summary/western/specifier/single_day.rb +63 -56
  65. data/lib/zakuro/calculation/type/old_float.rb +2 -2
  66. data/lib/zakuro/calculation/type/optional.rb +46 -0
  67. data/lib/zakuro/condition.rb +142 -92
  68. data/lib/zakuro/context/context.rb +44 -0
  69. data/lib/zakuro/context/option.rb +119 -0
  70. data/lib/zakuro/context/version_class_resolver.rb +112 -0
  71. data/lib/zakuro/era/japan/calendar.rb +35 -33
  72. data/lib/zakuro/era/japan/gengou/alignment/aligner.rb +8 -4
  73. data/lib/zakuro/era/japan/gengou/alignment/division.rb +117 -118
  74. data/lib/zakuro/era/japan/gengou/alignment/line.rb +7 -5
  75. data/lib/zakuro/era/japan/gengou/alignment/linear_gengou.rb +20 -14
  76. data/lib/zakuro/era/japan/gengou/alignment.rb +27 -25
  77. data/lib/zakuro/era/japan/gengou/resource/parser.rb +51 -34
  78. data/lib/zakuro/era/japan/gengou/resource/type.rb +45 -37
  79. data/lib/zakuro/era/japan/gengou/resource/validator.rb +34 -32
  80. data/lib/zakuro/era/japan/gengou.rb +28 -26
  81. data/lib/zakuro/era/japan/version.rb +18 -16
  82. data/lib/zakuro/era/western/calendar.rb +104 -88
  83. data/lib/zakuro/exception/case/pattern.rb +39 -3
  84. data/lib/zakuro/exception/case/preset.rb +2 -2
  85. data/lib/zakuro/exception/exception.rb +17 -15
  86. data/lib/zakuro/exception/zakuro_error.rb +19 -1
  87. data/lib/zakuro/gateway/locale/date.rb +2 -2
  88. data/lib/zakuro/gateway/locale/range.rb +3 -3
  89. data/lib/zakuro/gateway/range.rb +3 -3
  90. data/lib/zakuro/gateway/single.rb +14 -3
  91. data/lib/zakuro/merchant.rb +79 -9
  92. data/lib/zakuro/operation/month/parser.rb +252 -249
  93. data/lib/zakuro/operation/month/type.rb +17 -8
  94. data/lib/zakuro/operation/month/validator.rb +148 -144
  95. data/lib/zakuro/operation/operation.rb +38 -36
  96. data/lib/zakuro/operation/yaml/month.yaml +955 -281
  97. data/lib/zakuro/output/response.rb +107 -141
  98. data/lib/zakuro/result/data/option/abstract_option.rb +37 -0
  99. data/lib/zakuro/result/data/option/dropped_date/calculation.rb +47 -0
  100. data/lib/zakuro/result/data/option/dropped_date/option.rb +47 -0
  101. data/lib/zakuro/result/data/option/dropped_date/solar_term.rb +48 -0
  102. data/lib/zakuro/result/data/single_day.rb +9 -1
  103. data/lib/zakuro/result/operation/month/annotation.rb +2 -2
  104. data/lib/zakuro/result/operation/month/history.rb +2 -2
  105. data/lib/zakuro/result/operation/month.rb +31 -0
  106. data/lib/zakuro/result/operation.rb +39 -0
  107. data/lib/zakuro/result/result.rb +3 -3
  108. data/lib/zakuro/tools/stringifier.rb +67 -42
  109. data/lib/zakuro/tools/typeconv.rb +17 -15
  110. data/lib/zakuro/tools/typeof.rb +15 -13
  111. data/lib/zakuro/version/daien/cycle/remainder.rb +2 -2
  112. data/lib/zakuro/version/daien/monthly/lunar_phase.rb +10 -12
  113. data/lib/zakuro/version/daien/option/dropped_date/parameter.rb +31 -0
  114. data/lib/zakuro/version/daien/range/annual_range.rb +19 -17
  115. data/lib/zakuro/version/daien/stella/lunar/adjustment.rb +42 -37
  116. data/lib/zakuro/version/daien/stella/lunar/localization.rb +16 -14
  117. data/lib/zakuro/version/daien/stella/lunar/value.rb +52 -47
  118. data/lib/zakuro/version/daien/stella/origin/average_november.rb +15 -13
  119. data/lib/zakuro/version/daien/stella/origin/lunar_age.rb +23 -21
  120. data/lib/zakuro/version/daien/stella/origin/winter_solstice.rb +22 -20
  121. data/lib/zakuro/version/daien/stella/solar/adjustment.rb +12 -10
  122. data/lib/zakuro/version/daien/stella/solar/average.rb +53 -51
  123. data/lib/zakuro/version/daien/stella/solar/interval.rb +19 -17
  124. data/lib/zakuro/version/daien/stella/solar/value.rb +13 -11
  125. data/lib/zakuro/version/genka/cycle/remainder.rb +4 -4
  126. data/lib/zakuro/version/genka/monthly/lunar_phase.rb +7 -5
  127. data/lib/zakuro/version/genka/option/dropped_date/parameter.rb +31 -0
  128. data/lib/zakuro/version/genka/range/annual_range.rb +48 -44
  129. data/lib/zakuro/version/genka/stella/origin/first_term.rb +30 -28
  130. data/lib/zakuro/version/genka/stella/origin/january.rb +22 -20
  131. data/lib/zakuro/version/gihou/cycle/remainder.rb +2 -2
  132. data/lib/zakuro/version/gihou/monthly/lunar_phase.rb +9 -9
  133. data/lib/zakuro/version/gihou/option/dropped_date/parameter.rb +31 -0
  134. data/lib/zakuro/version/gihou/range/annual_range.rb +19 -17
  135. data/lib/zakuro/version/gihou/stella/lunar/adjustment.rb +42 -37
  136. data/lib/zakuro/version/gihou/stella/lunar/localization.rb +16 -14
  137. data/lib/zakuro/version/gihou/stella/lunar/value.rb +52 -47
  138. data/lib/zakuro/version/gihou/stella/origin/average_november.rb +15 -13
  139. data/lib/zakuro/version/gihou/stella/origin/lunar_age.rb +23 -21
  140. data/lib/zakuro/version/gihou/stella/origin/winter_solstice.rb +24 -22
  141. data/lib/zakuro/version/gihou/stella/solar/adjustment.rb +12 -10
  142. data/lib/zakuro/version/gihou/stella/solar/average.rb +52 -50
  143. data/lib/zakuro/version/gihou/stella/solar/interval.rb +19 -17
  144. data/lib/zakuro/version/gihou/stella/solar/value.rb +13 -11
  145. data/lib/zakuro/version/senmyou/const/remainder.rb +7 -1
  146. data/lib/zakuro/version/senmyou/cycle/remainder.rb +37 -2
  147. data/lib/zakuro/version/senmyou/monthly/lunar_phase.rb +10 -10
  148. data/lib/zakuro/version/senmyou/option/dropped_date/parameter.rb +33 -0
  149. data/lib/zakuro/version/senmyou/range/annual_range.rb +19 -17
  150. data/lib/zakuro/version/senmyou/stella/lunar/adjustment.rb +42 -36
  151. data/lib/zakuro/version/senmyou/stella/lunar/localization.rb +16 -14
  152. data/lib/zakuro/version/senmyou/stella/lunar/value.rb +39 -34
  153. data/lib/zakuro/version/senmyou/stella/origin/average_november.rb +15 -13
  154. data/lib/zakuro/version/senmyou/stella/origin/lunar_age.rb +23 -21
  155. data/lib/zakuro/version/senmyou/stella/origin/winter_solstice.rb +22 -20
  156. data/lib/zakuro/version/senmyou/stella/solar/adjustment.rb +12 -10
  157. data/lib/zakuro/version/senmyou/stella/solar/average.rb +52 -50
  158. data/lib/zakuro/version/senmyou/stella/solar/interval.rb +19 -17
  159. data/lib/zakuro/version/senmyou/stella/solar/value.rb +13 -11
  160. metadata +27 -7
  161. data/lib/zakuro/calculation/range/operated_solar_terms.rb +0 -218
  162. data/lib/zakuro/result/operation/month/bundle.rb +0 -36
  163. data/lib/zakuro/result/operation/operation.rb +0 -44
  164. data/lib/zakuro/version/context.rb +0 -44
  165. data/lib/zakuro/version/version_class_resolver.rb +0 -74
@@ -13,20 +13,22 @@ module Zakuro
13
13
  # AverageNovember 11月経
14
14
  #
15
15
  module AverageNovember
16
- #
17
- # 11月経朔(冬至が含まれる月の1日)を求める
18
- #
19
- # @param [Integer] western_year 西暦年
20
- #
21
- # @return [Remainder] 11月経朔
22
- #
23
- def self.get(western_year:)
24
- # 冬至
25
- winter_solstice = WinterSolstice.get(western_year: western_year)
26
- # 天正閏余
27
- lunar_age = LunarAge.get(western_year: western_year)
16
+ class << self
17
+ #
18
+ # 11月経朔(冬至が含まれる月の1日)を求める
19
+ #
20
+ # @param [Integer] western_year 西暦年
21
+ #
22
+ # @return [Remainder] 11月経朔
23
+ #
24
+ def get(western_year:)
25
+ # 冬至
26
+ winter_solstice = WinterSolstice.get(western_year: western_year)
27
+ # 天正閏余
28
+ lunar_age = LunarAge.get(western_year: western_year)
28
29
 
29
- winter_solstice.sub(lunar_age)
30
+ winter_solstice.sub(lunar_age)
31
+ end
30
32
  end
31
33
  end
32
34
  end
@@ -28,33 +28,35 @@ module Zakuro
28
28
 
29
29
  # :reek:TooManyStatements { max_statements: 7 }
30
30
 
31
- #
32
- # 対象年の天正閏余(冬至より前にある11月経朔との差 = 月齢)を算出する
33
- # 太陽と月の運動による補正値を算出し、その補正結果を返す
34
- #
35
- # @param [Integer] western_year 西暦年
36
- #
37
- # @return [Remainder] 天正閏余
38
- #
39
- def self.get(western_year:)
40
- # 積年の開始から対象年までの年数
41
- total = TOTAL_YEAR + western_year - BEGIN_YEAR
31
+ class << self
32
+ #
33
+ # 対象年の天正閏余(冬至より前にある11月経朔との差 = 月齢)を算出する
34
+ # 太陽と月の運動による補正値を算出し、その補正結果を返す
35
+ #
36
+ # @param [Integer] western_year 西暦年
37
+ #
38
+ # @return [Remainder] 天正閏余
39
+ #
40
+ def get(western_year:)
41
+ # 積年の開始から対象年までの年数
42
+ total = TOTAL_YEAR + western_year - BEGIN_YEAR
42
43
 
43
- # 12朔望月に対する1年の余り(単位:分)
44
- remainder_minute = YEAR - (SYNODIC_MONTH * 12)
44
+ # 12朔望月に対する1年の余り(単位:分)
45
+ remainder_minute = YEAR - (SYNODIC_MONTH * 12)
45
46
 
46
- # 朔望月に含まれなかった余り(単位:年)
47
- remainder_year = total % SYNODIC_MONTH
47
+ # 朔望月に含まれなかった余り(単位:年)
48
+ remainder_year = total % SYNODIC_MONTH
48
49
 
49
- LOGGER.debug("[01]: #{remainder_year}")
50
+ LOGGER.debug("[01]: #{remainder_year}")
50
51
 
51
- # 天正閏余
52
- lunar_age = remainder_minute * remainder_year % SYNODIC_MONTH
52
+ # 天正閏余
53
+ lunar_age = remainder_minute * remainder_year % SYNODIC_MONTH
53
54
 
54
- LOGGER.debug("[02]: #{lunar_age}")
55
+ LOGGER.debug("[02]: #{lunar_age}")
55
56
 
56
- # 大余・小余に変換する
57
- Cycle::Remainder.new(total: lunar_age)
57
+ # 大余・小余に変換する
58
+ Cycle::Remainder.new(total: lunar_age)
59
+ end
58
60
  end
59
61
  end
60
62
  end
@@ -28,26 +28,28 @@ module Zakuro
28
28
 
29
29
  # :reek:TooManyStatements { max_statements: 6 }
30
30
 
31
- #
32
- # 対象年の前年の冬至を求める
33
- #
34
- # @param [Integer] western_year 西暦年
35
- #
36
- # @return [Remainder] 前年の冬至
37
- #
38
- def self.get(western_year:)
39
- # 積年の開始から対象年までの年数
40
- total = TOTAL_YEAR + western_year - BEGIN_YEAR
41
- remainder_year = total % SIXTY_DAYS
42
-
43
- LOGGER.debug("[01]:#{remainder_year}")
44
-
45
- # 通余を使う
46
- winter_solstice_minute = (remainder_year * REMAINDER_ALL_YEAR) % SIXTY_DAYS
47
-
48
- LOGGER.debug("[02]:#{winter_solstice_minute}")
49
-
50
- Cycle::Remainder.new(total: winter_solstice_minute)
31
+ class << self
32
+ #
33
+ # 対象年の前年の冬至を求める
34
+ #
35
+ # @param [Integer] western_year 西暦年
36
+ #
37
+ # @return [Remainder] 前年の冬至
38
+ #
39
+ def get(western_year:)
40
+ # 積年の開始から対象年までの年数
41
+ total = TOTAL_YEAR + western_year - BEGIN_YEAR
42
+ remainder_year = total % SIXTY_DAYS
43
+
44
+ LOGGER.debug("[01]:#{remainder_year}")
45
+
46
+ # 通余を使う
47
+ winter_solstice_minute = (remainder_year * REMAINDER_ALL_YEAR) % SIXTY_DAYS
48
+
49
+ LOGGER.debug("[02]:#{winter_solstice_minute}")
50
+
51
+ Cycle::Remainder.new(total: winter_solstice_minute)
52
+ end
51
53
  end
52
54
  end
53
55
  end
@@ -76,16 +76,18 @@ module Zakuro
76
76
  taisetsu: Row.new(stack: -449.0, per_term: +28.4618, per_day: +0.3695) # 大雪(たいせつ)
77
77
  }.freeze
78
78
 
79
- #
80
- # 24気損益眺朒(ちょうじく)数の行データを特定する
81
- #
82
- # @param [Integer] index 連番(二十四節気)
83
- #
84
- # @return [Row] 行データ
85
- #
86
- def self.specify(index:)
87
- key = Cycle::SolarTerm::ORDER[index]
88
- Adjustment::MAP[key].clone
79
+ class << self
80
+ #
81
+ # 24気損益眺朒(ちょうじく)数の行データを特定する
82
+ #
83
+ # @param [Integer] index 連番(二十四節気)
84
+ #
85
+ # @return [Row] 行データ
86
+ #
87
+ def specify(index:)
88
+ key = Cycle::SolarTerm::ORDER[index]
89
+ Adjustment::MAP[key].clone
90
+ end
89
91
  end
90
92
  end
91
93
  end
@@ -26,7 +26,7 @@ module Zakuro
26
26
  # @param [Integer] western_year 西暦年
27
27
  #
28
28
  def initialize(western_year:)
29
- solar_term = Average.first_solar_term(western_year: western_year)
29
+ solar_term = self.class.first_solar_term(western_year: western_year)
30
30
  super(solar_term: solar_term)
31
31
  end
32
32
 
@@ -41,55 +41,57 @@ module Zakuro
41
41
  super(annual_range: annual_range)
42
42
  end
43
43
 
44
- #
45
- # 計算開始する二十四節気を求める
46
- #
47
- # @param [Integer] western_year 西暦年
48
- #
49
- # @return [SolarTerm] 二十四節気
50
- #
51
- def self.first_solar_term(western_year:)
52
- # 天正冬至
53
- winter_solstice = Origin::WinterSolstice.get(western_year: western_year)
54
-
55
- # 二十四節気(冬至)
56
- solar_term = Cycle::SolarTerm.new(index: 0, remainder: winter_solstice)
57
-
58
- first_solar_term_index = Average.calc_first_solar_term_index(western_year: western_year)
59
-
60
- # 対象の二十四節気まで戻す
61
- solar_term.prev_by_index(first_solar_term_index)
62
-
63
- solar_term
64
- end
65
-
66
- # :reek:TooManyStatements { max_statements: 6 }
67
-
68
- #
69
- # 計算開始する二十四節気番号を求める
70
- #
71
- # * 前提として入定気は冬至の手前にある
72
- # * 例えば、定気が大雪であれば入定気は大雪の範囲内にある
73
- # * 入定気は、定気の開始位置に重複しない限り、常に定気より後にある
74
- # * 基本的に定気の一つ前から起算すれば、当時から求めた11月(閏10/閏11月)に二十四節気を割り当てられる
75
- #
76
- # @param [Integer] western_year 西暦年
77
- #
78
- # @return [Integer] 二十四節気番号
79
- #
80
- def self.calc_first_solar_term_index(western_year:)
81
- # 天正閏余
82
- lunar_age = Origin::LunarAge.get(western_year: western_year)
83
-
84
- solar_location = Solar::Location.new(lunar_age: lunar_age)
85
- solar_location.run
86
-
87
- solar_term_index = solar_location.index
88
-
89
- # 入定気の一つ後の二十四節気まで戻す(ただし11月経朔が二十四節気上にある場合は戻さない)
90
- solar_term_index += 1 unless solar_location.remainder.day.zero?
91
-
92
- solar_term_index
44
+ class << self
45
+ #
46
+ # 計算開始する二十四節気を求める
47
+ #
48
+ # @param [Integer] western_year 西暦年
49
+ #
50
+ # @return [SolarTerm] 二十四節気
51
+ #
52
+ def first_solar_term(western_year:)
53
+ # 天正冬至
54
+ winter_solstice = Origin::WinterSolstice.get(western_year: western_year)
55
+
56
+ # 二十四節気(冬至)
57
+ solar_term = Cycle::SolarTerm.new(index: 0, remainder: winter_solstice)
58
+
59
+ first_solar_term_index = calc_first_solar_term_index(western_year: western_year)
60
+
61
+ # 対象の二十四節気まで戻す
62
+ solar_term.prev_by_index(first_solar_term_index)
63
+
64
+ solar_term
65
+ end
66
+
67
+ # :reek:TooManyStatements { max_statements: 6 }
68
+
69
+ #
70
+ # 計算開始する二十四節気番号を求める
71
+ #
72
+ # * 前提として入定気は冬至の手前にある
73
+ # * 例えば、定気が大雪であれば入定気は大雪の範囲内にある
74
+ # * 入定気は、定気の開始位置に重複しない限り、常に定気より後にある
75
+ # * 基本的に定気の一つ前から起算すれば、当時から求めた11月(閏10/閏11月)に二十四節気を割り当てられる
76
+ #
77
+ # @param [Integer] western_year 西暦年
78
+ #
79
+ # @return [Integer] 二十四節気番号
80
+ #
81
+ def calc_first_solar_term_index(western_year:)
82
+ # 天正閏余
83
+ lunar_age = Origin::LunarAge.get(western_year: western_year)
84
+
85
+ solar_location = Solar::Location.new(lunar_age: lunar_age)
86
+ solar_location.run
87
+
88
+ solar_term_index = solar_location.index
89
+
90
+ # 入定気の一つ後の二十四節気まで戻す(ただし11月経朔が二十四節気上にある場合は戻さない)
91
+ solar_term_index += 1 unless solar_location.remainder.day.zero?
92
+
93
+ solar_term_index
94
+ end
93
95
  end
94
96
  end
95
97
  end
@@ -78,24 +78,26 @@ module Zakuro
78
78
  MAP[:taisetsu] # 23
79
79
  ].freeze
80
80
 
81
- #
82
- # 入気定日加減数を引き当てる
83
- #
84
- # @param [Integer] index 二十四節気番号
85
- #
86
- # @return [Cycle::Remainder] 入気定日加減数
87
- #
88
- def self.index_of(index)
89
- LIST[index]
90
- end
81
+ class << self
82
+ #
83
+ # 入気定日加減数を引き当てる
84
+ #
85
+ # @param [Integer] index 二十四節気番号
86
+ #
87
+ # @return [Cycle::Remainder] 入気定日加減数
88
+ #
89
+ def index_of(index)
90
+ LIST[index]
91
+ end
91
92
 
92
- #
93
- # 入気定日加減数の総数を返す
94
- #
95
- # @return [Integer] 入気定日加減数の総数
96
- #
97
- def self.size
98
- LIST.size
93
+ #
94
+ # 入気定日加減数の総数を返す
95
+ #
96
+ # @return [Integer] 入気定日加減数の総数
97
+ #
98
+ def size
99
+ LIST.size
100
+ end
99
101
  end
100
102
  end
101
103
  end
@@ -19,19 +19,21 @@ module Zakuro
19
19
  # @return [Integer] 1日
20
20
  DAY = Const::Number::Cycle::DAY
21
21
 
22
- #
23
- # 太陽の運行による補正値を算出する
24
- #
25
- # @param [SolarTerm] solar_location 入定気
26
- #
27
- # @return [Integer] 補正値
28
- #
29
- def self.get(solar_location:)
30
- remainder = solar_location.remainder
22
+ class << self
23
+ #
24
+ # 太陽の運行による補正値を算出する
25
+ #
26
+ # @param [SolarTerm] solar_location 入定気
27
+ #
28
+ # @return [Integer] 補正値
29
+ #
30
+ def get(solar_location:)
31
+ remainder = solar_location.remainder
31
32
 
32
- row = Adjustment.specify(index: solar_location.index)
33
+ row = Adjustment.specify(index: solar_location.index)
33
34
 
34
- Calculation::Solar::ChoukeiValue.get(remainder: remainder, row: row)
35
+ Calculation::Solar::ChoukeiValue.get(remainder: remainder, row: row)
36
+ end
35
37
  end
36
38
  end
37
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zakuro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pldb
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-18 00:00:00.000000000 Z
11
+ date: 2022-09-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: mainly lunar solar calendar
14
14
  email:
@@ -29,6 +29,8 @@ files:
29
29
  - VERSION
30
30
  - bin/console
31
31
  - bin/setup
32
+ - doc/dropped_date.md
33
+ - doc/error.md
32
34
  - doc/gengou.md
33
35
  - doc/operation.md
34
36
  - doc/operation/csv/month.csv
@@ -41,6 +43,7 @@ files:
41
43
  - images/各月の求め方.png
42
44
  - images/太陽と月.png
43
45
  - lib/zakuro.rb
46
+ - lib/zakuro/calculation/base/day.rb
44
47
  - lib/zakuro/calculation/base/gengou.rb
45
48
  - lib/zakuro/calculation/base/linear_gengou.rb
46
49
  - lib/zakuro/calculation/base/operated_year.rb
@@ -66,11 +69,15 @@ files:
66
69
  - lib/zakuro/calculation/era/version/internal/range.rb
67
70
  - lib/zakuro/calculation/era/version/version.rb
68
71
  - lib/zakuro/calculation/monthly/abstract_lunar_phase.rb
72
+ - lib/zakuro/calculation/monthly/const.rb
69
73
  - lib/zakuro/calculation/monthly/first_day.rb
70
74
  - lib/zakuro/calculation/monthly/initialized_month.rb
71
75
  - lib/zakuro/calculation/monthly/month.rb
72
76
  - lib/zakuro/calculation/monthly/month_label.rb
73
77
  - lib/zakuro/calculation/monthly/operated_month.rb
78
+ - lib/zakuro/calculation/monthly/operated_solar_term.rb
79
+ - lib/zakuro/calculation/option/dropped_date/abstract_parameter.rb
80
+ - lib/zakuro/calculation/option/dropped_date/location.rb
74
81
  - lib/zakuro/calculation/range/abstract_full_range.rb
75
82
  - lib/zakuro/calculation/range/abstract_operation_range.rb
76
83
  - lib/zakuro/calculation/range/dated_full_range.rb
@@ -78,7 +85,7 @@ files:
78
85
  - lib/zakuro/calculation/range/medieval_annual_range.rb
79
86
  - lib/zakuro/calculation/range/named_full_range.rb
80
87
  - lib/zakuro/calculation/range/named_operation_range.rb
81
- - lib/zakuro/calculation/range/operated_solar_terms.rb
88
+ - lib/zakuro/calculation/range/operated_solar_term.rb
82
89
  - lib/zakuro/calculation/range/transfer/gengou_scroller.rb
83
90
  - lib/zakuro/calculation/range/transfer/year_boundary.rb
84
91
  - lib/zakuro/calculation/stella/lunar/abstract_location.rb
@@ -86,17 +93,24 @@ files:
86
93
  - lib/zakuro/calculation/stella/solar/abstract_average.rb
87
94
  - lib/zakuro/calculation/stella/solar/abstract_location.rb
88
95
  - lib/zakuro/calculation/stella/solar/choukei_value.rb
96
+ - lib/zakuro/calculation/summary/internal/day.rb
89
97
  - lib/zakuro/calculation/summary/internal/month.rb
90
98
  - lib/zakuro/calculation/summary/internal/operation.rb
99
+ - lib/zakuro/calculation/summary/internal/option.rb
91
100
  - lib/zakuro/calculation/summary/japan/range.rb
92
101
  - lib/zakuro/calculation/summary/japan/single.rb
93
102
  - lib/zakuro/calculation/summary/japan/specifier/single_day.rb
103
+ - lib/zakuro/calculation/summary/japan/specifier/specified_range.rb
94
104
  - lib/zakuro/calculation/summary/western/range.rb
95
105
  - lib/zakuro/calculation/summary/western/single.rb
96
106
  - lib/zakuro/calculation/summary/western/specifier/multiple_day.rb
97
107
  - lib/zakuro/calculation/summary/western/specifier/single_day.rb
98
108
  - lib/zakuro/calculation/type/old_float.rb
109
+ - lib/zakuro/calculation/type/optional.rb
99
110
  - lib/zakuro/condition.rb
111
+ - lib/zakuro/context/context.rb
112
+ - lib/zakuro/context/option.rb
113
+ - lib/zakuro/context/version_class_resolver.rb
100
114
  - lib/zakuro/era/japan/calendar.rb
101
115
  - lib/zakuro/era/japan/gengou.rb
102
116
  - lib/zakuro/era/japan/gengou/alignment.rb
@@ -136,24 +150,28 @@ files:
136
150
  - lib/zakuro/result/data/day.rb
137
151
  - lib/zakuro/result/data/gengou.rb
138
152
  - lib/zakuro/result/data/month.rb
153
+ - lib/zakuro/result/data/option/abstract_option.rb
154
+ - lib/zakuro/result/data/option/dropped_date/calculation.rb
155
+ - lib/zakuro/result/data/option/dropped_date/option.rb
156
+ - lib/zakuro/result/data/option/dropped_date/solar_term.rb
139
157
  - lib/zakuro/result/data/single_day.rb
140
158
  - lib/zakuro/result/data/solar_term.rb
141
159
  - lib/zakuro/result/data/year.rb
160
+ - lib/zakuro/result/operation.rb
161
+ - lib/zakuro/result/operation/month.rb
142
162
  - lib/zakuro/result/operation/month/annotation.rb
143
- - lib/zakuro/result/operation/month/bundle.rb
144
163
  - lib/zakuro/result/operation/month/history.rb
145
- - lib/zakuro/result/operation/operation.rb
146
164
  - lib/zakuro/result/result.rb
147
165
  - lib/zakuro/tools/stringifier.rb
148
166
  - lib/zakuro/tools/typeconv.rb
149
167
  - lib/zakuro/tools/typeof.rb
150
- - lib/zakuro/version/context.rb
151
168
  - lib/zakuro/version/daien/const/number.rb
152
169
  - lib/zakuro/version/daien/const/remainder.rb
153
170
  - lib/zakuro/version/daien/cycle/remainder.rb
154
171
  - lib/zakuro/version/daien/cycle/solar_term.rb
155
172
  - lib/zakuro/version/daien/daien.rb
156
173
  - lib/zakuro/version/daien/monthly/lunar_phase.rb
174
+ - lib/zakuro/version/daien/option/dropped_date/parameter.rb
157
175
  - lib/zakuro/version/daien/range/annual_range.rb
158
176
  - lib/zakuro/version/daien/stella/lunar/adjustment.rb
159
177
  - lib/zakuro/version/daien/stella/lunar/localization.rb
@@ -173,6 +191,7 @@ files:
173
191
  - lib/zakuro/version/genka/cycle/solar_term.rb
174
192
  - lib/zakuro/version/genka/genka.rb
175
193
  - lib/zakuro/version/genka/monthly/lunar_phase.rb
194
+ - lib/zakuro/version/genka/option/dropped_date/parameter.rb
176
195
  - lib/zakuro/version/genka/range/annual_range.rb
177
196
  - lib/zakuro/version/genka/stella/origin/first_term.rb
178
197
  - lib/zakuro/version/genka/stella/origin/january.rb
@@ -183,6 +202,7 @@ files:
183
202
  - lib/zakuro/version/gihou/cycle/solar_term.rb
184
203
  - lib/zakuro/version/gihou/gihou.rb
185
204
  - lib/zakuro/version/gihou/monthly/lunar_phase.rb
205
+ - lib/zakuro/version/gihou/option/dropped_date/parameter.rb
186
206
  - lib/zakuro/version/gihou/range/annual_range.rb
187
207
  - lib/zakuro/version/gihou/stella/lunar/adjustment.rb
188
208
  - lib/zakuro/version/gihou/stella/lunar/localization.rb
@@ -206,6 +226,7 @@ files:
206
226
  - lib/zakuro/version/senmyou/cycle/remainder.rb
207
227
  - lib/zakuro/version/senmyou/cycle/solar_term.rb
208
228
  - lib/zakuro/version/senmyou/monthly/lunar_phase.rb
229
+ - lib/zakuro/version/senmyou/option/dropped_date/parameter.rb
209
230
  - lib/zakuro/version/senmyou/range/annual_range.rb
210
231
  - lib/zakuro/version/senmyou/senmyou.rb
211
232
  - lib/zakuro/version/senmyou/stella/lunar/adjustment.rb
@@ -221,7 +242,6 @@ files:
221
242
  - lib/zakuro/version/senmyou/stella/solar/location.rb
222
243
  - lib/zakuro/version/senmyou/stella/solar/value.rb
223
244
  - lib/zakuro/version/tenpou/tenpou.rb
224
- - lib/zakuro/version/version_class_resolver.rb
225
245
  - zakuro.gemspec
226
246
  homepage: https://github.com/pldb/zakuro
227
247
  licenses: