Module: Wheneverd::DSL::AtNormalizer
- Defined in:
- lib/wheneverd/dsl/at_normalizer.rb
Overview
Validates and normalizes the at: option from the schedule DSL.
at: can be a single string (e.g. "4:30 am") or an array of strings (multiple run times).
Class Method Summary collapse
-
.normalize(at, path:) ⇒ Array<String>
Normalized time strings (not parsed).
Class Method Details
.normalize(at, path:) ⇒ Array<String>
Returns normalized time strings (not parsed).
12 13 14 15 16 17 18 19 20 |
# File 'lib/wheneverd/dsl/at_normalizer.rb', line 12 def self.normalize(at, path:) return [] if at.nil? return [normalize_string(at, path: path)] if at.is_a?(String) return normalize_array(at, path: path) if at.is_a?(Array) raise InvalidAtError.new("at: must be a String or an Array of Strings", path: path) end |