Class: Zakuro::Calculation::Version::Range

Inherits:
Object
  • Object
show all
Defined in:
lib/zakuro/calculation/era/version/internal/range.rb

Overview

Range 暦(範囲)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, start_date:, start_year:, last_year:) ⇒ Range

初期化

Parameters:

  • name (String)

    暦名

  • start_date (Western::Calendar)

    暦の開始日

  • start_year (Integer)

    開始西暦年

  • last_year (Integer)

    終了西暦年



30
31
32
33
34
35
# File 'lib/zakuro/calculation/era/version/internal/range.rb', line 30

def initialize(name:, start_date:, start_year:, last_year:)
  @name = name
  @start_date = start_date
  @start_year = start_year
  @last_year = last_year
end

Instance Attribute Details

#last_yearInteger (readonly)

Returns 終了西暦年.

Returns:

  • (Integer)

    終了西暦年



20
21
22
# File 'lib/zakuro/calculation/era/version/internal/range.rb', line 20

def last_year
  @last_year
end

#nameString (readonly)

Returns 暦名.

Returns:

  • (String)

    暦名



14
15
16
# File 'lib/zakuro/calculation/era/version/internal/range.rb', line 14

def name
  @name
end

#start_dateWestern::Calendar (readonly)

Returns 暦の開始日.

Returns:



16
17
18
# File 'lib/zakuro/calculation/era/version/internal/range.rb', line 16

def start_date
  @start_date
end

#start_yearInteger (readonly)

Returns 開始西暦年.

Returns:

  • (Integer)

    開始西暦年



18
19
20
# File 'lib/zakuro/calculation/era/version/internal/range.rb', line 18

def start_year
  @start_year
end