Sha256: c8f7e9f948c8dc512660039706b7473775b8528446b6f4cd967e5d6030f9d7a5

Contents?: true

Size: 357 Bytes

Versions: 11

Compression:

Stored size: 357 Bytes

Contents

module Liquid
  class Ifchanged < Block
    def render(context)
      context.stack do
        output = super

        if output != context.registers[:ifchanged]
          context.registers[:ifchanged] = output
          output
        else
          ''.freeze
        end
      end
    end
  end

  Template.register_tag('ifchanged'.freeze, Ifchanged)
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
liquid-4.0.4 lib/liquid/tags/ifchanged.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/liquid-4.0.3/lib/liquid/tags/ifchanged.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/liquid-4.0.3/lib/liquid/tags/ifchanged.rb
liquid-4.0.3 lib/liquid/tags/ifchanged.rb
liquid-4.0.2 lib/liquid/tags/ifchanged.rb
liquid-4-0-2-4.0.2 lib/liquid/tags/ifchanged.rb
liquid-4.0.1 lib/liquid/tags/ifchanged.rb
liquid-4.0.0 lib/liquid/tags/ifchanged.rb
liquid-4.0.0.rc3 lib/liquid/tags/ifchanged.rb
liquid-4.0.0.rc2 lib/liquid/tags/ifchanged.rb
liquid-4.0.0.rc1 lib/liquid/tags/ifchanged.rb