Module: Zakuro::Calculation::Monthly::MetaCollector

Defined in:
lib/zakuro/calculation/monthly/internal/meta/meta_collector.rb

Overview

MetaCollector メタ情報の収集

前月データを次のように扱う

  1. 範囲内の最初の月は無視する

* 元号範囲は常に余裕を持って取っている
* 求めたい日付よりは常に1ヶ月以上を計算範囲にしている
* 元嘉暦の最初の月は無視する
  * 元嘉暦は正月始まり
  * 初めの月は手前の月がないため前月がない
  * 没日・滅日の対象外のため不要とする
  1. 年境界を解決した後の1年データで再度移行する

* 冬至データの最初の月には前月がない
* 1年データにすることで前月が生まれるので再度移行する
  1. 暦の切り替えを考慮する

* 手前の月が異なる暦であれば、その月のデータを参照する

Class Method Summary collapse

Class Method Details

.get(before_month:, current_month:) ⇒ Monthly::Meta

メタ情報を取得する

Parameters:

Returns:



41
42
43
44
45
46
47
48
49
50
# File 'lib/zakuro/calculation/monthly/internal/meta/meta_collector.rb', line 41

def get(before_month:, current_month:)
  Monthly::Meta.new(
    all_solar_terms: all_solar_terms(
      before_month: before_month, current_month: current_month
    ),
    last_average_remainder: last_average_remainder(
      before_month: before_month
    )
  )
end