module IceCube::Validations::SecondOfMinute
Public Instance Methods
Source
# File lib/ice_cube/validations/second_of_minute.rb, line 17 def realign(opening_time, start_time) return super unless validations[:second_of_minute] first_second = Array(validations[:second_of_minute]).min_by(&:value) time = TimeUtil::TimeWrapper.new(start_time, false) time.sec = first_second.value super(opening_time, time.to_time) end
Calls superclass method
Source
# File lib/ice_cube/validations/second_of_minute.rb, line 3 def second_of_minute(*seconds) seconds.flatten.each do |second| unless second.is_a?(Integer) raise ArgumentError, "Expecting Integer value for second, got #{second.inspect}" end verify_alignment(second, :sec, :second_of_minute) { |error| raise error } validations_for(:second_of_minute) << Validation.new(second) end clobber_base_validations :sec self end