Class: IceCube::Validations::FixedValue
- Inherits:
-
Object
- Object
- IceCube::Validations::FixedValue
- Defined in:
- lib/ice_cube/validations/fixed_value.rb
Overview
This abstract validation class is used by the various “fixed-time” (e.g. day, day_of_month, hour_of_day) Validation and ScheduleLock::Validation modules. It is not a standalone rule validation module like the others.
Given the including Validation’s defined type
field, it will lock to the specified value
or else the corresponding time unit from the schedule’s start_time
Direct Known Subclasses
Day::Validation, DayOfMonth::Validation, HourOfDay::Validation, MinuteOfHour::Validation, MonthOfYear::Validation, ScheduleLock::Validation, SecondOfMinute::Validation
Constant Summary collapse
- INTERVALS =
{min: 60, sec: 60, hour: 24, month: 12, wday: 7}
Instance Method Summary collapse
Instance Method Details
#validate(time, start_time) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/ice_cube/validations/fixed_value.rb', line 13 def validate(time, start_time) case type when :day then validate_day_lock(time, start_time) when :hour then validate_hour_lock(time, start_time) else validate_interval_lock(time, start_time) end end |