Module: Kernel
- Defined in:
- lib/time_of_day/core_ext.rb
Instance Method Summary collapse
-
#TimeOfDay(string_or_int, *ints) ⇒ Object
rubocop: disable Naming/MethodName.
Instance Method Details
#TimeOfDay(string_or_int, *ints) ⇒ Object
rubocop: disable Naming/MethodName
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/time_of_day/core_ext.rb', line 36 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 |