Class: Zakuro::Operation::SolarTerm::Destination

Inherits:
Object
  • Object
show all
Defined in:
lib/zakuro/operation/month/type.rb

Overview

Destination 二十四節気(移動先)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index: -1,, from: Western::Calendar.new, zodiac_name: '') ⇒ Destination

初期化

Parameters:

  • index (Integer) (defaults to: -1,)

    二十四節気番号

  • from (Western::Calendar) (defaults to: Western::Calendar.new)

    移動元の月初日

  • zodiac_name (String) (defaults to: '')

    十干十二支



320
321
322
323
324
# File 'lib/zakuro/operation/month/type.rb', line 320

def initialize(index: -1, from: Western::Calendar.new, zodiac_name: '')
  @index = index
  @from = from
  @zodiac_name = zodiac_name
end

Instance Attribute Details

#fromWestern::Calendar (readonly)

Returns 移動元の月初日.

Returns:



309
310
311
# File 'lib/zakuro/operation/month/type.rb', line 309

def from
  @from
end

#indexInteger (readonly)

Returns 二十四節気番号.

Returns:

  • (Integer)

    二十四節気番号



307
308
309
# File 'lib/zakuro/operation/month/type.rb', line 307

def index
  @index
end

#zodiac_nameString (readonly)

Returns 十干十二支.

Returns:

  • (String)

    十干十二支



311
312
313
# File 'lib/zakuro/operation/month/type.rb', line 311

def zodiac_name
  @zodiac_name
end

Instance Method Details

#invalid?True, False

無効か

Returns:

  • (True)

    無効

  • (False)

    有効



332
333
334
# File 'lib/zakuro/operation/month/type.rb', line 332

def invalid?
  index == -1
end