Class: IceCube::Validations::HourOfDay::Validation

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

Returns a new instance of Validation.


41
42
43
# File 'lib/ice_cube/validations/hour_of_day.rb', line 41

def initialize(hour)
  @hour = hour
end

Instance Attribute Details

#hourObject (readonly) Also known as: value

Returns the value of attribute hour


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

def hour
  @hour
end

Instance Method Details

#build_hash(builder) ⇒ Object


61
62
63
# File 'lib/ice_cube/validations/hour_of_day.rb', line 61

def build_hash(builder)
  builder.validations_array(:hour_of_day) << hour
end

#build_ical(builder) ⇒ Object


65
66
67
# File 'lib/ice_cube/validations/hour_of_day.rb', line 65

def build_ical(builder)
  builder['BYHOUR'] << hour
end

#build_s(builder) ⇒ Object


57
58
59
# File 'lib/ice_cube/validations/hour_of_day.rb', line 57

def build_s(builder)
  builder.piece(:hour_of_day) << StringBuilder.nice_number(hour)
end

#dst_adjust?Boolean

Returns:

  • (Boolean)

53
54
55
# File 'lib/ice_cube/validations/hour_of_day.rb', line 53

def dst_adjust?
  true
end

#keyObject


45
46
47
# File 'lib/ice_cube/validations/hour_of_day.rb', line 45

def key
  :hour_of_day
end

#typeObject


49
50
51
# File 'lib/ice_cube/validations/hour_of_day.rb', line 49

def type
  :hour
end