Sha256: 75b77a6e89d4e876b97e1ebb8a4359bed114a7d4d7bfb6e4be6247249531190b
Contents?: true
Size: 1.5 KB
Versions: 8
Compression:
Stored size: 1.5 KB
Contents
# frozen_string_literal: true require_relative '../../../../output/logger' require_relative '../../const/number' # :nodoc: module Zakuro # :nodoc: module Gihou # :nodoc: module Origin # # WinterSolstice 冬至 # module WinterSolstice # @return [Integer] 通余 REMAINDER_ALL_YEAR = Const::Number::Derivation::REMAINDER_ALL_YEAR # @return [Integer] 60日 SIXTY_DAYS = Const::Number::Derivation::SIXTY_DAYS # @return [Integer] 積年 TOTAL_YEAR = Const::Number::Stack::TOTAL_YEAR # @return [Integer] 暦の開始年 BEGIN_YEAR = Const::Number::Stack::BEGIN_YEAR # @return [Output::Logger] ロガー LOGGER = Output::Logger.new(location: 'winter_solstice') # :reek:TooManyStatements { max_statements: 6 } # # 対象年の前年の冬至を求める # # @param [Integer] western_year 西暦年 # # @return [Remainder] 前年の冬至 # def self.get(western_year:) # 積年の開始から対象年までの年数 total = TOTAL_YEAR + western_year - BEGIN_YEAR remainder_year = total % SIXTY_DAYS LOGGER.debug("[01]:#{remainder_year}") # 通余を使う winter_solstice_minute = (remainder_year * REMAINDER_ALL_YEAR) % SIXTY_DAYS LOGGER.debug("[02]:#{winter_solstice_minute}") Cycle::Remainder.new(total: winter_solstice_minute) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems