Module: IceCube::Validations::DayOfMonth

Included in:
DailyRule, HourlyRule, MinutelyRule, MonthlyRule, SecondlyRule, YearlyRule
Defined in:
lib/ice_cube/validations/day_of_month.rb

Defined Under Namespace

Classes: Validation

Instance Method Summary collapse

Instance Method Details

#day_of_month(*days) ⇒ Object



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

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