Sha256: 6ae0920faeb843d18725679bfcf2c493564fb3a503873bab18998c981898ac8c
Contents?: true
Size: 448 Bytes
Versions: 12
Compression:
Stored size: 448 Bytes
Contents
# frozen_string_literal: true module Attribeauty module Types # custom Time type class Time def cast(value) return if value.nil? case value when Time value when Date, DateTime value.to_time when Integer ::Time.at(value / 1000.0) when Numeric ::Time.at(value) else ::Time.parse(value) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems