Module: IceCube::Validations::DayOfYear

Included in:
HourlyRule, MinutelyRule, SecondlyRule, YearlyRule
Defined in:
lib/ice_cube/validations/day_of_year.rb

Defined Under Namespace

Classes: Validation

Instance Method Summary collapse

Instance Method Details

#day_of_year(*days) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ice_cube/validations/day_of_year.rb', line 3

def day_of_year(*days)
  days.flatten.each do |day|
    unless day.is_a?(Integer)
      raise ArgumentError, "expecting Integer value for day, got #{day.inspect}"
    end
    validations_for(:day_of_year) << Validation.new(day)
  end
  clobber_base_validations(:month, :day, :wday)
  self
end