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.



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

def initialize(hour)
  @hour = hour
end

Instance Attribute Details

#hourObject (readonly) Also known as: value

Returns the value of attribute hour.



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

def hour
  @hour
end

Instance Method Details

#build_hash(builder) ⇒ Object



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

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

#build_ical(builder) ⇒ Object



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

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

#build_s(builder) ⇒ Object



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

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

#dst_adjust?Boolean

Returns:

  • (Boolean)


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

def dst_adjust?
  true
end

#keyObject



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

def key
  :hour_of_day
end

#typeObject



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

def type
  :hour
end