class IceCube::Validations::Until::Validation
Attributes
Public Class Methods
Source
# File lib/ice_cube/validations/until.rb, line 19 def initialize(time) @time = time end
Public Instance Methods
Source
# File lib/ice_cube/validations/until.rb, line 41 def build_hash(builder) builder[:until] = TimeUtil.serialize_time(time) end
Source
# File lib/ice_cube/validations/until.rb, line 45 def build_ical(builder) builder["UNTIL"] << IcalBuilder.ical_utc_format(time) end
Source
# File lib/ice_cube/validations/until.rb, line 36 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
Source
# File lib/ice_cube/validations/until.rb, line 31 def validate(step_time, start_time) end_time = TimeUtil.ensure_time(time, start_time, true) raise UntilExceeded if step_time > end_time end