Module: IceCube::Validations::MonthOfYear

Included in:
IceCube::ValidatedRule
Defined in:
lib/ice_cube/validations/month_of_year.rb

Defined Under Namespace

Classes: Validation

Instance Method Summary collapse

Instance Method Details

#month_of_year(*months) ⇒ Object



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

def month_of_year(*months)
  months.each do |month|
    month = TimeUtil.symbol_to_month(month.to_sym) if month.is_a?(Symbol) or month.is_a?(String)
    validations_for(:month_of_year) << Validation.new(month)
  end
  clobber_base_validations :month
  self
end