Sha256: 19de1aaaa54c3d91808f8fec3dab991d1ed45daf651151eec1ecb5596c93b527

Contents?: true

Size: 462 Bytes

Versions: 10

Compression:

Stored size: 462 Bytes

Contents

# frozen_string_literal: true
module Temple
  module Filters
    class Ambles < Filter
      define_options :preamble, :postamble

      def initialize(*)
        super
        @preamble = options[:preamble]
        @postamble = options[:postamble]
      end

      def call(ast)
        ret = [:multi]
        ret << [:static, @preamble] if @preamble
        ret << ast
        ret << [:static, @postamble] if @postamble
        ret
      end
    end
  end
end

Version data entries

10 entries across 9 versions & 3 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/filters/ambles.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/temple-0.10.3/lib/temple/filters/ambles.rb
brakeman-7.0.0 bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/filters/ambles.rb
brakeman-6.2.2 bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/filters/ambles.rb
brakeman-6.2.2.rc1 bundle/ruby/3.3.0/gems/temple-0.10.3/lib/temple/filters/ambles.rb
brakeman-6.2.1 bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/filters/ambles.rb
brakeman-6.2.0 bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/filters/ambles.rb
temple-0.10.3 lib/temple/filters/ambles.rb
temple-0.10.2 lib/temple/filters/ambles.rb
temple-0.10.1 lib/temple/filters/ambles.rb