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

Inherits:
FixedValue
  • Object
show all
Defined in:
lib/ice_cube/validations/month_of_year.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(month) ⇒ Validation

Returns a new instance of Validation.



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

def initialize(month)
  @month = month
end

Instance Attribute Details

#monthObject (readonly) Also known as: value

Returns the value of attribute month.



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

def month
  @month
end

Instance Method Details

#build_hash(builder) ⇒ Object



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

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

#build_ical(builder) ⇒ Object



47
48
49
# File 'lib/ice_cube/validations/month_of_year.rb', line 47

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

#build_s(builder) ⇒ Object



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

def build_s(builder)
  builder.piece(:month_of_year) << IceCube::I18n.t("date.month_names")[month]
end

#dst_adjust?Boolean

Returns:

  • (Boolean)


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

def dst_adjust?
  true
end

#keyObject



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

def key
  :month_of_year
end

#typeObject



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

def type
  :month
end