Remove regex for downcase and is_a?(String)

This commit is contained in:
Kelley Reynolds
2014-12-18 13:01:23 -05:00
parent 8b0774b519
commit 84fddba2e1

View File

@@ -306,8 +306,10 @@ module Liquid
def to_date(obj)
return obj if obj.respond_to?(:strftime)
obj = obj.downcase if obj.is_a?(String)
case obj
when /\A(?:now|today)\z/i
when 'now'.freeze, 'today'.freeze
Time.now
when /\A\d+\z/, Integer
Time.at(obj.to_i)