Class: IceCube::Validations::MonthOfYear::Validation

Inherits:
Object
  • Object
show all
Includes:
Lock
Defined in:
lib/ice_cube/validations/month_of_year.rb

Constant Summary

Constants included from Lock

Lock::INTERVALS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Lock

#validate

Constructor Details

#initialize(month) ⇒ Validation

Returns a new instance of Validation.



24
25
26
# File 'lib/ice_cube/validations/month_of_year.rb', line 24

def initialize(month)
  @month = month
end

Instance Attribute Details

#monthObject (readonly) Also known as: value

Returns the value of attribute month.



21
22
23
# File 'lib/ice_cube/validations/month_of_year.rb', line 21

def month
  @month
end

Instance Method Details

#build_hash(builder) ⇒ Object



40
41
42
# File 'lib/ice_cube/validations/month_of_year.rb', line 40

def build_hash(builder)
  builder.validations_array(:month_of_year) << month
end

#build_ical(builder) ⇒ Object



44
45
46
# File 'lib/ice_cube/validations/month_of_year.rb', line 44

def build_ical(builder)
  builder['BYMONTH'] << month
end

#build_s(builder) ⇒ Object



36
37
38
# File 'lib/ice_cube/validations/month_of_year.rb', line 36

def build_s(builder)
  builder.piece(:month_of_year) << Date::MONTHNAMES[month]
end

#dst_adjust?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/ice_cube/validations/month_of_year.rb', line 32

def dst_adjust?
  true
end

#typeObject



28
29
30
# File 'lib/ice_cube/validations/month_of_year.rb', line 28

def type
  :month
end