Class: Zakuro::Calculation::Range::NamedOperationRange

Inherits:
AbstractOperationRange show all
Defined in:
lib/zakuro/calculation/range/named_operation_range.rb

Overview

NamedOperationRange 運用結果範囲

Constant Summary collapse

INVALID_NAME =

Returns 不正元号名.

Returns:

  • (String)

    不正元号名

Japan::Calendar::EMPTY

Instance Attribute Summary

Attributes inherited from AbstractOperationRange

#context, #operated_solar_term, #years

Instance Method Summary collapse

Methods inherited from AbstractOperationRange

commit, #get, move, move_into_last_year, move_into_next_year, reset_meta, resolve_month, #rewrite, rewrite_month, rewrite_year

Constructor Details

#initialize(context:, start_name: INVALID_NAME, last_name: INVALID_NAME, years: []) ⇒ NamedOperationRange

初期化

Parameters:

  • context (Context::Context)

    暦コンテキスト

  • start_name (String) (defaults to: INVALID_NAME)

    開始元号名

  • last_name (String) (defaults to: INVALID_NAME)

    終了元号名

  • years (Array<Year>) (defaults to: [])

    年データ(完全範囲)



28
29
30
31
32
33
34
# File 'lib/zakuro/calculation/range/named_operation_range.rb', line 28

def initialize(context:, start_name: INVALID_NAME, last_name: INVALID_NAME, years: [])
  scroll = Gengou::NamedScroll.new(
    start_name: start_name, last_name: last_name, operated: true
  )

  super(context: context, scroll: scroll, years: years)
end