Sha256: 1af1255b757e85e48a409fd691c4b91da0280f169f38aa8e2ad41514daa76ae7

Contents?: true

Size: 1.45 KB

Versions: 4

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

require_relative './alignment/aligner'

require_relative './resource'

# :nodoc:
module Zakuro
  # :nodoc:
  module Japan
    # :nodoc:
    module Gengou
      #
      # Alignment 整列
      #
      module Alignment
        # @return [Integer] 1行目元号
        FIRST_LINE = Aligner::FIRST_LINE

        # @return [Integer] 2行目元号
        SECOND_LINE = Aligner::SECOND_LINE

        # @return [Aligner] 整列結果
        SUMMARY = Aligner.new(resources: Resource::LIST)

        class << self
          #
          # 指定した範囲内の元号を取得する
          #
          # @param [Integer] line 行
          # @param [Western::Calendar] start_date 開始日
          # @param [Western::Calendar] last_date 終了日
          #
          # @return [Array<LinearGengou>] 元号
          #
          def get(line: FIRST_LINE,
                  start_date: Western::Calendar.new, last_date: Western::Calendar.new)

            SUMMARY.get(line: line, start_date: start_date, last_date: last_date)
          end

          #
          # 指定した範囲内の元号を取得する(元号名)
          #
          # @param [Integer] line 行
          # @param [String] name 元号名
          #
          # @return [Array<LinearGengou>] 元号
          #
          def get_by_name(line: FIRST_LINE, name:)
            SUMMARY.get_by_name(line: line, name: name)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zakuro-0.9.2 lib/zakuro/era/japan/gengou/alignment.rb
zakuro-0.9.1 lib/zakuro/era/japan/gengou/alignment.rb
zakuro-0.9.0 lib/zakuro/era/japan/gengou/alignment.rb
zakuro-0.8.0 lib/zakuro/era/japan/gengou/alignment.rb