Add reverse filter

This commit is contained in:
Jay Strybis
2013-03-07 16:29:39 -06:00
parent f7d1e1d0c1
commit a556ae6c26
2 changed files with 10 additions and 0 deletions
+6
View File
@@ -90,6 +90,12 @@ module Liquid
end
end
# Reverse the elements of an array
def reverse(input)
ary = [input].flatten
ary.reverse
end
# map/collect on a given property
def map(input, property)
ary = [input].flatten