Class: Zakuro::Calculation::Monthly::Meta

Inherits:
Object
  • Object
show all
Defined in:
lib/zakuro/calculation/monthly/internal/part/meta.rb

Overview

Meta 付加情報

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(all_solar_terms: [], last_average_remainder: Cycle::AbstractRemainder.new) ⇒ Meta

初期化

Parameters:

  • all_solar_terms (Array<AbstractSolarTerm>) (defaults to: [])

    月の全ての二十四節気

  • last_average_remainder (Cycle::AbstractRemainder) (defaults to: Cycle::AbstractRemainder.new)

    前月の平朔



43
44
45
46
# File 'lib/zakuro/calculation/monthly/internal/part/meta.rb', line 43

def initialize(all_solar_terms: [], last_average_remainder: Cycle::AbstractRemainder.new)
  @all_solar_terms = all_solar_terms
  @last_average_remainder = last_average_remainder
end

Instance Attribute Details

#all_solar_termsArray<Cycle::AbstractSolarTerm> (readonly)

Note:

前提として、『日本暦日原典』にある月ごとの二十四節気は、その月の全ての二十四節気ではない

下表を例に取った場合、『日本暦日原典』の二十四節気連番のうち、2と3がその月の二十四節気となるここで、当月のうち2より手前の日は前月の1の二十四節気に属しており、当月だけでは参照できないこの参照を可能とするための情報となる

|No| 項目 | 前月 | 当月 | 次月 | |1 | 月 | month[index - 1] | month | month[index + 1] | |2 | 考えられる範囲 | |——————-| | |3 | 二十四節気連番 | 0 1 | 2 3 | 4 5 | |4 | 二十四節気大余 | 55 10 | 25 40 | 55 5 |

Returns:



28
29
30
# File 'lib/zakuro/calculation/monthly/internal/part/meta.rb', line 28

def all_solar_terms
  @all_solar_terms
end

#last_average_remainderCycle::AbstractRemainder (readonly)

Note:

滅日計算に用いる

月の1日目で前月からの平朔が用いられている

Returns 前月の平朔.

Returns:



35
36
37
# File 'lib/zakuro/calculation/monthly/internal/part/meta.rb', line 35

def last_average_remainder
  @last_average_remainder
end

Instance Method Details

#initialize_copy(obj) ⇒ Object

ディープコピー

Parameters:

  • obj (Meta)

    自身



53
54
55
56
# File 'lib/zakuro/calculation/monthly/internal/part/meta.rb', line 53

def initialize_copy(obj)
  @all_solar_terms = obj.all_solar_terms.clone
  @last_average_remainder = obj.last_average_remainder.clone
end