Sha256: df14d0cf3209f8413a4f9a017a5b0c9ad429f9d3850ae5a108f062d013646dbb
Contents?: true
Size: 426 Bytes
Versions: 32
Compression:
Stored size: 426 Bytes
Contents
module Liquid module StandardFilters private # Fixme: Handle DateTime, Date and Time objects, convert them # into seconds (integer) def to_number(obj) case obj when Numeric obj when String (obj.strip =~ /^\d+\.\d+$/) ? obj.to_f : obj.to_i when DateTime, Date, Time obj.to_time.to_i else 0 end end end end
Version data entries
32 entries across 32 versions & 2 rubygems