Sha256: 3ca15e597e32bb8a76eeb129b6f3d8cb47c315fdf8ad7c2c48ede2e3baa4fb62

Contents?: true

Size: 1013 Bytes

Versions: 1

Compression:

Stored size: 1013 Bytes

Contents

# frozen_string_literal: true

require_relative '../era/gengou/named_scroll'
require_relative './abstract_full_range'

# :nodoc:
module Zakuro
  # :nodoc:
  module Calculation
    # :nodoc:
    module Range
      #
      # NamedFullRange 完全範囲
      #
      class NamedFullRange < AbstractFullRange
        # @return [String] 不正元号名
        INVALID_NAME = Japan::Calendar::EMPTY

        #
        # 初期化
        #
        # @param [Context] context 暦コンテキスト
        # @param [String] start_name 開始元号名
        # @param [String] last_name 終了元号名
        #
        def initialize(context:, start_name: INVALID_NAME, last_name: INVALID_NAME)
          scroll = Gengou::NamedScroll.new(start_name: start_name, last_name: last_name)
          range = scroll.range

          super(
            context: context, scroll: scroll,
            start_date: range.western_start_date, last_date: range.western_last_date
          )
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zakuro-0.7.0 lib/zakuro/calculation/range/named_full_range.rb