zakuro 0.1.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -1
- data/doc/gengou.md +22 -22
- data/doc/operation/csv/month.csv +468 -202
- data/doc/operation/operation.xlsx +0 -0
- data/lib/zakuro/calculation/base/operated_year.rb +114 -0
- data/lib/zakuro/calculation/base/year.rb +3 -0
- data/lib/zakuro/calculation/cycle/abstract_remainder.rb +29 -29
- data/lib/zakuro/calculation/monthly/abstract_lunar_phase.rb +169 -0
- data/lib/zakuro/calculation/monthly/first_day.rb +1 -1
- data/lib/zakuro/calculation/monthly/operated_month.rb +47 -3
- data/lib/zakuro/calculation/range/medieval_annual_range.rb +105 -0
- data/lib/zakuro/calculation/range/operated_range.rb +61 -16
- data/lib/zakuro/calculation/stella/lunar/abstract_location.rb +78 -0
- data/lib/zakuro/calculation/stella/lunar/choukei_value.rb +71 -0
- data/lib/zakuro/calculation/stella/solar/abstract_average.rb +117 -0
- data/lib/zakuro/calculation/stella/solar/abstract_location.rb +187 -0
- data/lib/zakuro/calculation/stella/solar/choukei_value.rb +136 -0
- data/lib/zakuro/calculation/type/old_float.rb +69 -0
- data/lib/zakuro/era/japan/reki.rb +1 -1
- data/lib/zakuro/era/japan/yaml/set-001-until-south.yaml +22 -22
- data/lib/zakuro/operation/month/type.rb +58 -0
- data/lib/zakuro/operation/yaml/month.yaml +8512 -0
- data/lib/zakuro/version/context.rb +1 -1
- data/lib/zakuro/version/daien/const/number.rb +55 -0
- data/lib/zakuro/version/daien/const/remainder.rb +53 -0
- data/lib/zakuro/version/daien/cycle/remainder.rb +85 -0
- data/lib/zakuro/version/daien/cycle/solar_term.rb +34 -0
- data/lib/zakuro/version/daien/daien.rb +36 -0
- data/lib/zakuro/version/daien/monthly/lunar_phase.rb +106 -0
- data/lib/zakuro/version/daien/range/annual_range.rb +39 -0
- data/lib/zakuro/version/daien/stella/lunar/adjustment.rb +240 -0
- data/lib/zakuro/version/daien/stella/lunar/localization.rb +44 -0
- data/lib/zakuro/version/daien/stella/lunar/location.rb +80 -0
- data/lib/zakuro/version/daien/stella/lunar/value.rb +75 -0
- data/lib/zakuro/version/daien/stella/origin/average_november.rb +34 -0
- data/lib/zakuro/version/daien/stella/origin/lunar_age.rb +62 -0
- data/lib/zakuro/version/daien/stella/origin/winter_solstice.rb +55 -0
- data/lib/zakuro/version/daien/stella/solar/adjustment.rb +93 -0
- data/lib/zakuro/version/daien/stella/solar/average.rb +98 -0
- data/lib/zakuro/version/daien/stella/solar/interval.rb +108 -0
- data/lib/zakuro/version/daien/stella/solar/location.rb +61 -0
- data/lib/zakuro/version/daien/stella/solar/value.rb +36 -0
- data/lib/zakuro/version/genka/const/number.rb +43 -0
- data/lib/zakuro/version/genka/const/remainder.rb +33 -0
- data/lib/zakuro/version/genka/cycle/remainder.rb +92 -0
- data/lib/zakuro/version/genka/cycle/solar_term.rb +34 -0
- data/lib/zakuro/version/genka/genka.rb +19 -2
- data/lib/zakuro/version/genka/monthly/lunar_phase.rb +95 -0
- data/lib/zakuro/version/genka/range/annual_range.rb +77 -0
- data/lib/zakuro/version/genka/stella/origin/first_term.rb +55 -0
- data/lib/zakuro/version/genka/stella/origin/january.rb +49 -0
- data/lib/zakuro/version/genka/stella/solar/average.rb +41 -0
- data/lib/zakuro/version/gihou/const/number.rb +55 -0
- data/lib/zakuro/version/gihou/const/remainder.rb +54 -0
- data/lib/zakuro/version/gihou/cycle/remainder.rb +82 -0
- data/lib/zakuro/version/gihou/cycle/solar_term.rb +34 -0
- data/lib/zakuro/version/gihou/gihou.rb +23 -2
- data/lib/zakuro/version/gihou/monthly/lunar_phase.rb +106 -0
- data/lib/zakuro/version/gihou/range/annual_range.rb +39 -0
- data/lib/zakuro/version/gihou/stella/lunar/adjustment.rb +250 -0
- data/lib/zakuro/version/gihou/stella/lunar/localization.rb +44 -0
- data/lib/zakuro/version/gihou/stella/lunar/location.rb +80 -0
- data/lib/zakuro/version/gihou/stella/lunar/value.rb +75 -0
- data/lib/zakuro/version/gihou/stella/origin/average_november.rb +34 -0
- data/lib/zakuro/version/gihou/stella/origin/lunar_age.rb +62 -0
- data/lib/zakuro/version/gihou/stella/origin/winter_solstice.rb +55 -0
- data/lib/zakuro/version/gihou/stella/solar/adjustment.rb +93 -0
- data/lib/zakuro/version/gihou/stella/solar/average.rb +97 -0
- data/lib/zakuro/version/gihou/stella/solar/interval.rb +108 -0
- data/lib/zakuro/version/gihou/stella/solar/location.rb +61 -0
- data/lib/zakuro/version/gihou/stella/solar/value.rb +36 -0
- data/lib/zakuro/version/senmyou/const/number.rb +1 -1
- data/lib/zakuro/version/senmyou/const/remainder.rb +7 -3
- data/lib/zakuro/version/senmyou/cycle/remainder.rb +27 -6
- data/lib/zakuro/version/senmyou/cycle/solar_term.rb +4 -1
- data/lib/zakuro/version/senmyou/monthly/lunar_phase.rb +12 -112
- data/lib/zakuro/version/senmyou/range/annual_range.rb +5 -77
- data/lib/zakuro/version/senmyou/stella/lunar/localization.rb +2 -3
- data/lib/zakuro/version/senmyou/stella/lunar/location.rb +13 -34
- data/lib/zakuro/version/senmyou/stella/lunar/value.rb +8 -30
- data/lib/zakuro/version/senmyou/stella/solar/adjustment.rb +29 -29
- data/lib/zakuro/version/senmyou/stella/solar/average.rb +14 -92
- data/lib/zakuro/version/senmyou/stella/solar/location.rb +18 -121
- data/lib/zakuro/version/senmyou/stella/solar/value.rb +4 -103
- data/lib/zakuro/version/version_class_resolver.rb +12 -0
- data/lib/zakuro/version.rb +1 -1
- data/lib/zakuro/version_factory.rb +1 -1
- metadata +61 -7
- data/lib/zakuro/version/taien/taien.rb +0 -19
@@ -0,0 +1,136 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../type/old_float'
|
4
|
+
|
5
|
+
# :nodoc:
|
6
|
+
module Zakuro
|
7
|
+
# :nodoc:
|
8
|
+
module Calculation
|
9
|
+
# :nodoc:
|
10
|
+
module Solar
|
11
|
+
#
|
12
|
+
# ChoukeiValue 再考長慶宣明暦算法
|
13
|
+
#
|
14
|
+
module ChoukeiValue
|
15
|
+
# @return [Output::Logger] ロガー
|
16
|
+
LOGGER = Output::Logger.new(location: 'solar_choukei')
|
17
|
+
|
18
|
+
#
|
19
|
+
# 補正値を返す
|
20
|
+
#
|
21
|
+
# @param [Cycle::AbstractRemainder] remainder 大余小余
|
22
|
+
# @param [Adjustment::Row] row 24気損益眺朒(ちょうじく)数
|
23
|
+
#
|
24
|
+
# @return [Integer] 補正値
|
25
|
+
#
|
26
|
+
def self.get(remainder:, row:)
|
27
|
+
# 損益率/眺朒(ちょうじく)数
|
28
|
+
# パラメータ:
|
29
|
+
# a: 眺朒(ちょうじく)数の初日の値
|
30
|
+
# b: 損益率初日の値
|
31
|
+
# c: 損益率の毎日の差
|
32
|
+
# n: 定気の日から数えた日数
|
33
|
+
|
34
|
+
# LOGGER.debug("row.per_day: #{row.per_day}")
|
35
|
+
# LOGGER.debug("row.stack: #{row.stack}")
|
36
|
+
|
37
|
+
day_stack = calc_day_stack(remainder: remainder, row: row)
|
38
|
+
|
39
|
+
# LOGGER.debug("day_stack: #{day_stack}")
|
40
|
+
|
41
|
+
month_stack = calc_month_stack(row: row, day: remainder.day)
|
42
|
+
|
43
|
+
# LOGGER.debug("month_stack: #{month_stack}")
|
44
|
+
|
45
|
+
# 冬至であれば眺朒数がプラスになり続けて損益率が「益」で、小雪であればマイナスの眺朒数がプラスされ続けて「損」
|
46
|
+
month_stack + day_stack
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# 損益率を求める
|
51
|
+
#
|
52
|
+
# @param [Remainder] remainder 入定気
|
53
|
+
# @param [Adjustment::Row] row 24気損益眺朒(ちょうじく)数
|
54
|
+
#
|
55
|
+
# @return [Integer] 損益率
|
56
|
+
#
|
57
|
+
def self.calc_day_stack(remainder:, row:)
|
58
|
+
ratio = calc_ratio(day: remainder.day, per_term: row.per_term, per_day: row.per_day)
|
59
|
+
|
60
|
+
# LOGGER.debug("ratio.sign: #{ratio.sign}")
|
61
|
+
# LOGGER.debug("ratio.abs: #{ratio.abs}")
|
62
|
+
|
63
|
+
calc_day_stack_from_ratio(
|
64
|
+
ratio: ratio, minute: remainder.minute, limit: remainder.base_day
|
65
|
+
)
|
66
|
+
end
|
67
|
+
private_class_method :calc_day_stack
|
68
|
+
|
69
|
+
#
|
70
|
+
# 大余に対応する損益率を求める
|
71
|
+
# 損益率 = b + n * c
|
72
|
+
#
|
73
|
+
# @param [Integer] day 大余
|
74
|
+
# @param [Integer] per_term 眺朒(ちょうじく)数
|
75
|
+
# @param [Integer] per_day 毎日差
|
76
|
+
#
|
77
|
+
# @return [Type::OldFloat] 大余に対応する損益率
|
78
|
+
#
|
79
|
+
def self.calc_ratio(day:, per_term:, per_day:)
|
80
|
+
ratio = Type::OldFloat.new(per_term + day * per_day)
|
81
|
+
# 小数点以下は無視する
|
82
|
+
ratio.floor!
|
83
|
+
|
84
|
+
ratio
|
85
|
+
end
|
86
|
+
private_class_method :calc_ratio
|
87
|
+
|
88
|
+
#
|
89
|
+
# 小余を含めた損益率を求める
|
90
|
+
#
|
91
|
+
# @param [Integer] sign 正負(大余に対応する損益率)
|
92
|
+
# @param [Integer] ratio 大余に対応する損益率
|
93
|
+
# @param [Integer] minute 小余
|
94
|
+
#
|
95
|
+
# @return [Integer] 小余を含めた損益率
|
96
|
+
#
|
97
|
+
def self.calc_day_stack_from_ratio(ratio:, minute:, limit:)
|
98
|
+
minute_stack = ratio.abs * minute
|
99
|
+
day_stack = (minute_stack / limit).floor
|
100
|
+
# 四捨五入
|
101
|
+
# NOTE 資料では「この余りが4200をこえていれば切り上げる」とあり「>=」とした
|
102
|
+
# 1612年の7月(慶長17年7月)が境界値4200だが、繰り上げを行なっていたため
|
103
|
+
day_stack += 1 if minute_stack % limit >= (limit / 2)
|
104
|
+
day_stack *= ratio.sign
|
105
|
+
|
106
|
+
day_stack
|
107
|
+
end
|
108
|
+
private_class_method :calc_day_stack_from_ratio
|
109
|
+
|
110
|
+
#
|
111
|
+
# 眺朒(ちょうじく)数を求める
|
112
|
+
# 眺朒(ちょうじく)数 = a + (n * b) + (1/2)n(n-1)c
|
113
|
+
#
|
114
|
+
# @param [Adjustment::Row] row 24気損益眺朒(ちょうじく)数
|
115
|
+
# @param [Integer] day 大余
|
116
|
+
#
|
117
|
+
# @return [Integer] 眺朒(ちょうじく)数
|
118
|
+
#
|
119
|
+
def self.calc_month_stack(row:, day:)
|
120
|
+
# row.stack: 眺朒(ちょうじく)積
|
121
|
+
# row.per_term: 眺朒(ちょうじく)数
|
122
|
+
# row.per_day: 毎日差
|
123
|
+
month_stack = Type::OldFloat.new(
|
124
|
+
row.stack + day * row.per_term + \
|
125
|
+
(1 / 2.0) * (day * (day - 1) * row.per_day)
|
126
|
+
)
|
127
|
+
# 切り捨て(プラスマイナスに関わらず小数点以下切り捨て)
|
128
|
+
month_stack.floor!
|
129
|
+
|
130
|
+
month_stack.get
|
131
|
+
end
|
132
|
+
private_class_method :calc_month_stack
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :nodoc:
|
4
|
+
module Zakuro
|
5
|
+
# :nodoc:
|
6
|
+
module Calculation
|
7
|
+
# :nodoc:
|
8
|
+
module Type
|
9
|
+
#
|
10
|
+
# OldFloat 浮動小数点数(古代)
|
11
|
+
#
|
12
|
+
# @note 四捨五入は常に絶対値に対して行う
|
13
|
+
# * value.negative? ? value.ceil : value.floor
|
14
|
+
# * 絶対値だけを取り出すことで、四捨五入を平易にする
|
15
|
+
#
|
16
|
+
class OldFloat
|
17
|
+
# @return [Integer] 符号
|
18
|
+
attr_reader :sign
|
19
|
+
# @return [Float] 絶対値
|
20
|
+
attr_reader :abs
|
21
|
+
|
22
|
+
#
|
23
|
+
# 初期化
|
24
|
+
#
|
25
|
+
# @param [Float] value 符号つき浮動小数点数
|
26
|
+
#
|
27
|
+
def initialize(value)
|
28
|
+
@sign = value.negative? ? -1 : 1
|
29
|
+
@abs = @sign * value
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# 四捨五入する
|
34
|
+
#
|
35
|
+
def floor!
|
36
|
+
@abs = floor
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# 四捨五入する(非破壊的)
|
41
|
+
#
|
42
|
+
# @return [Float] 絶対値
|
43
|
+
#
|
44
|
+
def floor
|
45
|
+
@abs.floor
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# 符号つき浮動小数点数を取得する
|
50
|
+
#
|
51
|
+
# @return [Float] 符号つき浮動小数点数
|
52
|
+
#
|
53
|
+
def get
|
54
|
+
@sign * @abs
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# 負数かどうか
|
59
|
+
#
|
60
|
+
# @return [True] 負数
|
61
|
+
# @return [False] 正数
|
62
|
+
#
|
63
|
+
def negative?
|
64
|
+
@sign == -1
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -44,7 +44,7 @@ module Zakuro
|
|
44
44
|
start_date: Western::Calendar.new(year: 698, month: 2, day: 16)
|
45
45
|
),
|
46
46
|
Range.new(
|
47
|
-
class_name: 'Zakuro::
|
47
|
+
class_name: 'Zakuro::Daien::Gateway',
|
48
48
|
start_date: Western::Calendar.new(year: 764, month: 2, day: 7)
|
49
49
|
),
|
50
50
|
Range.new(
|
@@ -3,103 +3,103 @@ name: "南北朝前+南朝"
|
|
3
3
|
# 元中9年閏10月4日
|
4
4
|
end_date: "1392-11-18"
|
5
5
|
list:
|
6
|
-
- name: "
|
6
|
+
- name: "允恭天皇"
|
7
7
|
# 34年1月1日
|
8
8
|
start_year: 34
|
9
9
|
start_date: "445-1-24"
|
10
10
|
new_year_date: "445-1-24"
|
11
11
|
note: ""
|
12
|
-
- name: "
|
12
|
+
- name: "安康天皇"
|
13
13
|
# 1年1月1日
|
14
14
|
start_year: 1
|
15
15
|
start_date: "454-2-14"
|
16
16
|
new_year_date: "454-2-14"
|
17
17
|
note: ""
|
18
|
-
- name: "
|
18
|
+
- name: "雄略天皇"
|
19
19
|
# 1年1月1日
|
20
20
|
start_year: 1
|
21
21
|
start_date: "457-2-10"
|
22
22
|
new_year_date: "457-2-10"
|
23
23
|
note: ""
|
24
|
-
- name: "
|
24
|
+
- name: "清寧天皇"
|
25
25
|
# 1年1月1日
|
26
26
|
start_year: 1
|
27
27
|
start_date: "480-1-28"
|
28
28
|
new_year_date: "480-1-28"
|
29
29
|
note: ""
|
30
|
-
- name: "
|
30
|
+
- name: "顕宗天皇"
|
31
31
|
# 1年1月1日
|
32
32
|
start_year: 1
|
33
33
|
start_date: "485-2-1"
|
34
34
|
new_year_date: "485-2-1"
|
35
35
|
note: ""
|
36
|
-
- name: "
|
36
|
+
- name: "仁賢天皇"
|
37
37
|
# 1年1月1日
|
38
38
|
start_year: 1
|
39
39
|
start_date: "488-1-29"
|
40
40
|
new_year_date: "488-1-29"
|
41
41
|
note: ""
|
42
|
-
- name: "
|
42
|
+
- name: "武烈天皇"
|
43
43
|
# 1年1月1日
|
44
44
|
start_year: 1
|
45
45
|
start_date: "499-1-28"
|
46
46
|
new_year_date: "499-1-28"
|
47
47
|
note: ""
|
48
|
-
- name: "
|
48
|
+
- name: "継体天皇"
|
49
49
|
# 1年1月1日
|
50
50
|
start_year: 1
|
51
51
|
start_date: "507-1-29"
|
52
52
|
new_year_date: "507-1-29"
|
53
53
|
note: ""
|
54
|
-
- name: "
|
54
|
+
- name: "安閑天皇"
|
55
55
|
# 1年1月1日
|
56
56
|
start_year: 1
|
57
57
|
start_date: "534-1-30"
|
58
58
|
new_year_date: "534-1-30"
|
59
59
|
note: ""
|
60
|
-
- name: "
|
60
|
+
- name: "宣化天皇"
|
61
61
|
# 1年1月1日
|
62
62
|
start_year: 1
|
63
63
|
start_date: "536-2-8"
|
64
64
|
new_year_date: "536-2-8"
|
65
65
|
note: ""
|
66
|
-
- name: "
|
66
|
+
- name: "欽明天皇"
|
67
67
|
# 1年1月1日
|
68
68
|
start_year: 1
|
69
69
|
start_date: "540-1-25"
|
70
70
|
new_year_date: "540-1-25"
|
71
71
|
note: ""
|
72
|
-
- name: "
|
72
|
+
- name: "敏達天皇"
|
73
73
|
# 1年1月1日
|
74
74
|
start_year: 1
|
75
75
|
start_date: "572-1-31"
|
76
76
|
new_year_date: "572-1-31"
|
77
77
|
note: ""
|
78
|
-
- name: "
|
78
|
+
- name: "用明天皇"
|
79
79
|
# 1年1月1日
|
80
80
|
start_year: 1
|
81
81
|
start_date: "586-1-25"
|
82
82
|
new_year_date: "586-1-25"
|
83
83
|
note: ""
|
84
|
-
- name: "
|
84
|
+
- name: "崇峻天皇"
|
85
85
|
# 1年1月1日
|
86
86
|
start_year: 1
|
87
87
|
start_date: "588-2-3"
|
88
88
|
new_year_date: "588-2-3"
|
89
89
|
note: ""
|
90
|
-
- name: "
|
90
|
+
- name: "推古天皇"
|
91
91
|
# 1年1月1日
|
92
92
|
start_year: 1
|
93
93
|
start_date: "593-2-7"
|
94
94
|
new_year_date: "593-2-7"
|
95
95
|
note: ""
|
96
|
-
- name: "
|
96
|
+
- name: "舒明天皇"
|
97
97
|
# 1年1月1日
|
98
98
|
start_year: 1
|
99
99
|
start_date: "629-1-30"
|
100
100
|
new_year_date: "629-1-30"
|
101
101
|
note: ""
|
102
|
-
- name: "
|
102
|
+
- name: "皇極天皇"
|
103
103
|
# 1年1月1日
|
104
104
|
start_year: 1
|
105
105
|
start_date: "642-2-5"
|
@@ -117,19 +117,19 @@ list:
|
|
117
117
|
start_date: "650-3-22"
|
118
118
|
new_year_date: "650-2-7"
|
119
119
|
note: ""
|
120
|
-
- name: "
|
120
|
+
- name: "斉明天皇"
|
121
121
|
# 1年1月1日
|
122
122
|
start_year: 1
|
123
123
|
start_date: "655-2-12"
|
124
124
|
new_year_date: "655-2-12"
|
125
125
|
note: ""
|
126
|
-
- name: "
|
126
|
+
- name: "天智天皇"
|
127
127
|
# 1年1月1日
|
128
128
|
start_year: 1
|
129
129
|
start_date: "662-1-25"
|
130
130
|
new_year_date: "662-1-25"
|
131
131
|
note: ""
|
132
|
-
- name: "
|
132
|
+
- name: "天武天皇"
|
133
133
|
# 1年1月1日
|
134
134
|
start_year: 1
|
135
135
|
start_date: "672-2-4"
|
@@ -141,13 +141,13 @@ list:
|
|
141
141
|
start_date: "686-8-14"
|
142
142
|
new_year_date: "686-1-30"
|
143
143
|
note: ""
|
144
|
-
- name: "
|
144
|
+
- name: "持統天皇"
|
145
145
|
# 1年1月1日
|
146
146
|
start_year: 1
|
147
147
|
start_date: "687-2-18"
|
148
148
|
new_year_date: "687-2-18"
|
149
149
|
note: ""
|
150
|
-
- name: "
|
150
|
+
- name: "文武天皇"
|
151
151
|
# 1年1月1日
|
152
152
|
start_year: 1
|
153
153
|
start_date: "697-1-28"
|
@@ -364,6 +364,64 @@ module Zakuro
|
|
364
364
|
def invalid?
|
365
365
|
@calc == -1 || @actual == -1
|
366
366
|
end
|
367
|
+
|
368
|
+
#
|
369
|
+
# 無効か
|
370
|
+
#
|
371
|
+
# @return [True] 無効
|
372
|
+
# @return [False] 有効
|
373
|
+
#
|
374
|
+
def valid?
|
375
|
+
!invalid?
|
376
|
+
end
|
377
|
+
|
378
|
+
#
|
379
|
+
# 差分の間隔
|
380
|
+
#
|
381
|
+
# @return [Integer] 間隔
|
382
|
+
#
|
383
|
+
def interval
|
384
|
+
@calc - @actual
|
385
|
+
end
|
386
|
+
|
387
|
+
#
|
388
|
+
# 年変化するか
|
389
|
+
#
|
390
|
+
# @return [True] 変化あり
|
391
|
+
# @return [False] 変化なし
|
392
|
+
#
|
393
|
+
def change_year?
|
394
|
+
return false unless valid?
|
395
|
+
|
396
|
+
# 1年分の変化(12ヶ月以上)なしと見なす
|
397
|
+
return false if interval.abs < 11
|
398
|
+
|
399
|
+
true
|
400
|
+
end
|
401
|
+
|
402
|
+
#
|
403
|
+
# 昨年の月か
|
404
|
+
#
|
405
|
+
# @return [True] 昨年
|
406
|
+
# @return [False] 昨年ではない
|
407
|
+
#
|
408
|
+
def last_year?
|
409
|
+
return false unless change_year?
|
410
|
+
|
411
|
+
interval.negative?
|
412
|
+
end
|
413
|
+
|
414
|
+
#
|
415
|
+
# 来年の月か
|
416
|
+
#
|
417
|
+
# @return [True] 来年
|
418
|
+
# @return [False] 来年ではない
|
419
|
+
#
|
420
|
+
def next_year?
|
421
|
+
return false unless change_year?
|
422
|
+
|
423
|
+
interval.positive?
|
424
|
+
end
|
367
425
|
end
|
368
426
|
|
369
427
|
#
|