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

Inherits:
FixedValue
  • Object
show all
Defined in:
lib/ice_cube/validations/day_of_month.rb

Constant Summary

Constants inherited from FixedValue

FixedValue::INTERVALS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from FixedValue

#validate

Constructor Details

#initialize(day) ⇒ Validation

Returns a new instance of Validation.


22
23
24
# File 'lib/ice_cube/validations/day_of_month.rb', line 22

def initialize(day)
  @day = day
end

Instance Attribute Details

#dayObject (readonly) Also known as: value

Returns the value of attribute day


19
20
21
# File 'lib/ice_cube/validations/day_of_month.rb', line 19

def day
  @day
end

Instance Method Details

#build_hash(builder) ⇒ Object


42
43
44
# File 'lib/ice_cube/validations/day_of_month.rb', line 42

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

#build_ical(builder) ⇒ Object


46
47
48
# File 'lib/ice_cube/validations/day_of_month.rb', line 46

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

#build_s(builder) ⇒ Object


38
39
40
# File 'lib/ice_cube/validations/day_of_month.rb', line 38

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

#dst_adjust?Boolean

Returns:

  • (Boolean)

34
35
36
# File 'lib/ice_cube/validations/day_of_month.rb', line 34

def dst_adjust?
  true
end

#keyObject


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

def key
  :day_of_month
end

#typeObject


30
31
32
# File 'lib/ice_cube/validations/day_of_month.rb', line 30

def type
  :day
end