Sha256: 744c67c77eb7139bf9ec127ebc97db8b41928a102ab570c9655a9da00d02bb87

Contents?: true

Size: 1022 Bytes

Versions: 5

Compression:

Stored size: 1022 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] 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

5 entries across 5 versions & 1 rubygems

Version Path
zakuro-0.9.2 lib/zakuro/calculation/range/named_full_range.rb
zakuro-0.9.1 lib/zakuro/calculation/range/named_full_range.rb
zakuro-0.9.0 lib/zakuro/calculation/range/named_full_range.rb
zakuro-0.8.0 lib/zakuro/calculation/range/named_full_range.rb
zakuro-0.7.2 lib/zakuro/calculation/range/named_full_range.rb