キリスト教の暦注(クリスマスと復活祭)
クリスマス
date - 西暦の年数 or When::TM::(Temporal)Position
frame - 暦法(デフォルトは When.IRI('_c:Gregorian'))
returns : クリスマスの日付
Integer - ユリウス通日(dateが西暦の年数の場合)
When::TM::CalDate - yearがWhen::TM::(Temporal)Positionの場合
# File when/region/christian.rb, line 201
201: def christmas(date, frame=nil)
202: _event(date, frame) do |year, frame|
203: @x - 1 + frame._coordinates_to_number(year, 2, 0)
204: end
205: end
復活祭
date - 西暦の年数 or When::TM::(Temporal)Position
frame - 暦法(デフォルトは When.IRI('_c:Gregorian'))
returns : 復活祭の日付
Integer - ユリウス通日(dateが西暦の年数の場合)
When::TM::CalDate - yearがWhen::TM::(Temporal)Positionの場合
# File when/region/christian.rb, line 215
215: def easter(date, frame=nil)
216: _event(date, frame) do |year, frame|
217: golden = (year+@b) % @s + 1
218: m = (frame._lunar_equation(year) + 11*golden + @c) % 30
219: if @f == 0
220: m += 1 if m==0 || m==1 && golden>=@n
221: else
222: m += (golden-1) / @f
223: m -= 30 if m>=@n
224: end
225: result = frame._coordinates_to_number(year, 2, 0) + @d - 1 - m
226: result += @g - (result-@w) % 7 if @w<7
227: result
228: end
229: end
オブジェクトの正規化
w - 週日補正フラグ(デフォルト 6) d - 最も遅い満月 (デフォルト 3月0日から 50日) x - クリスマス (デフォルト 3月0日から300日) n - 平年数 (デフォルト 12) s - 置閏周期 (デフォルト 19) c - 月の位相の補正(デフォルト 3) g - ガード (デフォルト 7) b - ベース (デフォルト 0) f - 満月補正フラグ(デフォルト 0)
# File when/region/christian.rb, line 252
252: def _normalize(args=[], options={})
253: w, d, x, n, s, c, g, b, f = args
254: @w = (w || @w || 6).to_i
255: @d = (d || @d || 50).to_i
256: @x = (x || @x || 300).to_i
257: @n = (n || @n || 12).to_i
258: @s = (s || @s || 19).to_i
259: @c = (c || @c || 3).to_i
260: @g = (g || @g || 7).to_i
261: @b = (b || @b || 0).to_i
262: @f = (f || @f || 0).to_i
263: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.