Module: Kernel

Defined in:
lib/time_of_day/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#TimeOfDay(string_or_int, *ints) ⇒ Object

rubocop: disable Naming/MethodName



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/time_of_day/core_ext.rb', line 33

def TimeOfDay(string_or_int, *ints)
  if string_or_int.is_a? String
    unless ints.empty?
      raise(ArgumentError, 'TimeOfDay() takes a string or multiple integers as arguments')
    end

    TimeOfDay.parse(string_or_int)
  else
    TimeOfDay.new(string_or_int, *ints)
  end
end