class IceCube::Validations::Until::Validation
Attributes
time[R]
Public Class Methods
new(time)
click to toggle source
# File lib/ice_cube/validations/until.rb, line 24 def initialize(time) @time = time end
Public Instance Methods
build_hash(builder)
click to toggle source
# File lib/ice_cube/validations/until.rb, line 45 def build_hash(builder) builder[:until] = TimeUtil.serialize_time(time) end
build_ical(builder)
click to toggle source
# File lib/ice_cube/validations/until.rb, line 49 def build_ical(builder) builder['UNTIL'] << IcalBuilder.ical_utc_format(time) end
build_s(builder)
click to toggle source
# File lib/ice_cube/validations/until.rb, line 40 def build_s(builder) date = IceCube::I18n.l(time, format: IceCube.to_s_time_format) builder.piece(:until) << IceCube::I18n.t('ice_cube.until', date: date) end
dst_adjust?()
click to toggle source
# File lib/ice_cube/validations/until.rb, line 32 def dst_adjust? false end
type()
click to toggle source
# File lib/ice_cube/validations/until.rb, line 28 def type :limit end
validate(step_time, schedule)
click to toggle source
# File lib/ice_cube/validations/until.rb, line 36 def validate(step_time, schedule) raise UntilExceeded if step_time > time end