Sha256: 069e3bcceea13160c23d171a83c4ade34ed14af20537f525d1c8a2e166a3b845
Contents?: true
Size: 783 Bytes
Versions: 12
Compression:
Stored size: 783 Bytes
Contents
module Virtus class Coercion # Coerce Time values class Time < Object extend TimeCoercions primitive ::Time # Passthrough the value # # @example # Virtus::Coercion::DateTime.to_time(time) # => Time object # # @param [DateTime] value # # @return [Date] # # @api public def self.to_time(value) value end # Creates a Fixnum instance from a Time object # # @example # Virtus::Coercion::Time.to_integer(time) # => Fixnum object # # @param [Time] value # # @return [Fixnum] # # @api public def self.to_integer(value) value.to_i end end # class Time end # class Coercion end # module Virtus
Version data entries
12 entries across 12 versions & 2 rubygems