Class: Zakuro::Operation::Month

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

Overview

Month 月差分

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number: Number.new, leaped: Leaped.new, is_many_days: Days.new) ⇒ Month

初期化

Parameters:

  • number (Number) (defaults to: Number.new)

  • leaped (Leaped) (defaults to: Leaped.new)

    閏有無

  • days (Days)

    月の大小



200
201
202
203
204
# File 'lib/zakuro/operation/month/type.rb', line 200

def initialize(number: Number.new, leaped: Leaped.new, is_many_days: Days.new)
  @number = number
  @leaped = leaped
  @is_many_days = is_many_days
end

Instance Attribute Details

#is_many_daysDays (readonly)

Returns 月の大小.

Returns:

  • (Days)

    月の大小



189
190
191
# File 'lib/zakuro/operation/month/type.rb', line 189

def is_many_days
  @is_many_days
end

#leapedLeaped (readonly)

Returns 閏有無.

Returns:



187
188
189
# File 'lib/zakuro/operation/month/type.rb', line 187

def leaped
  @leaped
end

#numberNumber (readonly)

Returns 月.

Returns:



185
186
187
# File 'lib/zakuro/operation/month/type.rb', line 185

def number
  @number
end

Instance Method Details

#invalid?True, False

無効か

Returns:

  • (True)

    無効

  • (False)

    有効



212
213
214
# File 'lib/zakuro/operation/month/type.rb', line 212

def invalid?
  number == -1
end