Sha256: d9de079e8b8b3b559f76ea215f98df6005da6c2b17975da7d26134d9b4e3bded
Contents?: true
Size: 547 Bytes
Versions: 170
Compression:
Stored size: 547 Bytes
Contents
module Temple module Filters # Flattens nested multi expressions # # @api public class MultiFlattener < Filter def on_multi(*exps) # If the multi contains a single element, just return the element return compile(exps.first) if exps.size == 1 result = [:multi] exps.each do |exp| exp = compile(exp) if exp.first == :multi result.concat(exp[1..-1]) else result << exp end end result end end end end
Version data entries
170 entries across 156 versions & 8 rubygems