Class: IceCube::Validations::SecondOfMinute::Validation

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

Returns a new instance of Validation.



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

def initialize(second)
  @second = second
end

Instance Attribute Details

#secondObject (readonly) Also known as: value

Returns the value of attribute second.



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

def second
  @second
end

Instance Method Details

#build_hash(builder) ⇒ Object



37
38
39
# File 'lib/ice_cube/validations/second_of_minute.rb', line 37

def build_hash(builder)
  builder.validations_array(:second_of_minute) << second
end

#build_ical(builder) ⇒ Object



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

def build_ical(builder)
  builder['BYSECOND'] << second
end

#build_s(builder) ⇒ Object



33
34
35
# File 'lib/ice_cube/validations/second_of_minute.rb', line 33

def build_s(builder)
  builder.piece(:second_of_minute) << StringBuilder.nice_number(second)
end

#typeObject



29
30
31
# File 'lib/ice_cube/validations/second_of_minute.rb', line 29

def type
  :sec
end