Sha256: 4472ddc5908e6adf9d43f9d9452409c43c4a8a7421122f9627c2c0eedb199faf
Contents?: true
Size: 469 Bytes
Versions: 8
Compression:
Stored size: 469 Bytes
Contents
module SmsAero::Types # Describes coercible Unix time in future Future = Strict::Int.constructor do |value| begin error = TypeError.new "#{value.inspect} is not a valid time in future" time = value.to_time if value.respond_to? :to_time time ||= ::Time.parse(value.to_s) unless value.is_a? Numeric number = time.to_i number > ::Time.now.to_i ? number : raise(error) rescue raise error end end end
Version data entries
8 entries across 8 versions & 1 rubygems