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

Version Path
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
brakeman-4.6.1 bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
brakeman-4.6.0 bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
brakeman-4.5.1 bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
brakeman-4.5.0 bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/filters/multi_flattener.rb
temple-0.8.1 lib/temple/filters/multi_flattener.rb
brakeman-4.4.0 bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/filters/multi_flattener.rb
brakeman-4.3.1 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/filters/multi_flattener.rb