Class: Zakuro::Version::Gihou::Lunar::Location

Inherits:
Calculation::Lunar::AbstractLocation show all
Defined in:
lib/zakuro/version/gihou/stella/lunar/location.rb

Overview

Location 入暦

Constant Summary collapse

ANOMALISTIC_MONTH =

Returns 1近点月.

Returns:

Const::Remainder::Lunar::ANOMALISTIC_MONTH
QUARTER =

Returns 弦.

Returns:

Const::Remainder::Lunar::QUARTER

Instance Attribute Summary

Attributes inherited from Calculation::Lunar::AbstractLocation

#calculated, #quarter, #remainder, #western_year

Instance Method Summary collapse

Methods inherited from Calculation::Lunar::AbstractLocation

#add_quarter, #adjusted_remainder

Constructor Details

#initialize(lunar_age:, western_year:) ⇒ Location

初期化

Parameters:

  • lunar_age (Cycle::LunarRemainder)

    天正閏余(大余小余)

  • western_year (Integer)

    西暦年



32
33
34
35
36
37
38
# File 'lib/zakuro/version/gihou/stella/lunar/location.rb', line 32

def initialize(lunar_age:, western_year:)
  super(
    lunar_age: lunar_age,
    quarter: QUARTER,
    western_year: western_year
  )
end

Instance Method Details

#runObject

入暦を計算する



43
44
45
46
47
48
49
50
# File 'lib/zakuro/version/gihou/stella/lunar/location.rb', line 43

def run
  if calculated
    decrease(limit: ANOMALISTIC_MONTH)
    return
  end

  first
end