Module: IceCube::Validations::Lock
- Defined in:
- lib/ice_cube/validations/lock.rb
Overview
This validation mixin 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 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
Constant Summary collapse
- INTERVALS =
{:min => 60, :sec => 60, :hour => 24, :month => 12, :wday => 7}
Instance Method Summary collapse
Instance Method Details
#validate(time, schedule) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/ice_cube/validations/lock.rb', line 15 def validate(time, schedule) case type when :day then validate_day_lock(time, schedule) when :hour then validate_hour_lock(time, schedule) else validate_interval_lock(time, schedule) end end |