Class: IceCube::Validations::DayOfMonth::Validation

Inherits:
Object
  • Object
show all
Includes:
Lock
Defined in:
lib/ice_cube/validations/day_of_month.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(day) ⇒ Validation

Returns a new instance of Validation.



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

def initialize(day)
  @day = day
end

Instance Attribute Details

#dayObject (readonly) Also known as: value

Returns the value of attribute day.



25
26
27
# File 'lib/ice_cube/validations/day_of_month.rb', line 25

def day
  @day
end

Instance Method Details

#build_hash(builder) ⇒ Object



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

def build_hash(builder)
  builder.validations_array(:day_of_month) << day
end

#build_ical(builder) ⇒ Object



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

def build_ical(builder)
  builder['BYMONTHDAY'] << day
end

#build_s(builder) ⇒ Object



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

def build_s(builder)
  builder.piece(:day_of_month) << StringBuilder.nice_number(day)
end

#typeObject



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

def type
  :day
end