Class: Zakuro::Operation::SolarTerm::Direction

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

Overview

Direction 二十四節気(移動)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source: Source.new, destination: Destination.new, days: INVALID_DAY_VALUE) ⇒ Direction

初期化

Parameters:

  • source (Source) (defaults to: Source.new)

    二十四節気(移動元)

  • destination (Destination) (defaults to: Destination.new)

    二十四節気(移動先)

  • day (Integer)

    大余差分



239
240
241
242
243
244
# File 'lib/zakuro/operation/month/type.rb', line 239

def initialize(source: Source.new, destination: Destination.new,
               days: INVALID_DAY_VALUE)
  @source = source
  @destination = destination
  @days = days
end

Instance Attribute Details

#daysInteger (readonly)

Returns 大余差分.

Returns:

  • (Integer)

    大余差分



230
231
232
# File 'lib/zakuro/operation/month/type.rb', line 230

def days
  @days
end

#destinationDestination (readonly)

Returns 二十四節気(移動先).

Returns:



228
229
230
# File 'lib/zakuro/operation/month/type.rb', line 228

def destination
  @destination
end

#sourceSource (readonly)

Returns 二十四節気(移動元).

Returns:

  • (Source)

    二十四節気(移動元)



226
227
228
# File 'lib/zakuro/operation/month/type.rb', line 226

def source
  @source
end

Instance Method Details

#invalid?True, False

無効か

Returns:

  • (True)

    無効

  • (False)

    有効



262
263
264
# File 'lib/zakuro/operation/month/type.rb', line 262

def invalid?
  source.invalid? && destination.invalid?
end

#invalid_days?True, False

無効か(大余差分)

Returns:

  • (True)

    無効

  • (False)

    有効



252
253
254
# File 'lib/zakuro/operation/month/type.rb', line 252

def invalid_days?
  days == INVALID_DAY_VALUE
end