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 22 def initialize(time) @time = time end
Public Instance Methods
build_hash(builder)
click to toggle source
# File lib/ice_cube/validations/until.rb, line 44 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 48 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 39 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 30 def dst_adjust? false end
type()
click to toggle source
# File lib/ice_cube/validations/until.rb, line 26 def type :limit end
validate(step_time, start_time)
click to toggle source
# File lib/ice_cube/validations/until.rb, line 34 def validate(step_time, start_time) end_time = TimeUtil.ensure_time(time, start_time, true) raise UntilExceeded if step_time > end_time end