module IceCube::Validations::Year

Allows addition of a year (non-standard cron) to the repeat rules.

Public Instance Methods

year(*years) click to toggle source

Call to filter occurrences to one or more years.

# File lib/ice_cube_ext/validations/year.rb, line 12
def year(*years)
  years.flatten.each do |year|
    raise ArgumentError, "expecting Fixnum value for year, got #{year.inspect}" unless year.is_a?(Integer)

    validations_for(:year) << Validation.new(year)
  end

  ::IceCube::Validations::FixedValue::INTERVALS[:year] = 100
  self
end