Module: Zakuro::Tool::Typeof

Defined in:
lib/zakuro/tool/typeof.rb

Overview

Typeof 型判定

Class Method Summary collapse

Class Method Details

.time?(obj:) ⇒ True, False

時間を表す型か

Parameters:

  • obj (Object)

    引数

Returns:

  • (True)

    時間型である

  • (False)

    時間型ではない



26
27
28
29
30
31
32
33
34
# File 'lib/zakuro/tool/typeof.rb', line 26

def time?(obj:)
  return true if obj.is_a?(Japan::Calendar)

  return true if obj.is_a?(Western::Calendar)

  return true if obj.is_a?(Calculation::Cycle::AbstractRemainder)

  false
end