Module: IceCube::Validations::Year
- Included in:
- IceCube::ValidatedRule
- Defined in:
- lib/ice_cube_ext/validations/year.rb
Overview
Allows addition of a year (non-standard cron) to the repeat rules.
Defined Under Namespace
Classes: Validation
Instance Method Summary collapse
-
#year(*years) ⇒ Object
Call to filter occurrences to one or more years.
Instance Method Details
#year(*years) ⇒ Object
Call to filter occurrences to one or more years.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ice_cube_ext/validations/year.rb', line 10 def year(*years) years.flatten.each do |year| unless year.is_a?(Fixnum) raise ArgumentError, "expecting Fixnum value for year, got #{year.inspect}" end validations_for(:year) << Validation.new(year) end ::IceCube::Validations::FixedValue::INTERVALS[:year] = 100 self end |