Sha256: aca3d16cc622e27d5381782dc2f53b4fe8264eccbd498221746017360f61abf2

Contents?: true

Size: 369 Bytes

Versions: 5

Compression:

Stored size: 369 Bytes

Contents

module Liquid
  class Ifchanged < Block

    def render(context)
      context.stack do

        output = render_all(@nodelist, context)

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

  Template.register_tag('ifchanged', Ifchanged)
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
locomotivecms-liquid-2.6.0 lib/liquid/tags/ifchanged.rb
locomotive_liquid-2.4.2 lib/liquid/tags/ifchanged.rb
locomotive_liquid-2.4.1 lib/liquid/tags/ifchanged.rb
locomotive_liquid-2.2.3 lib/liquid/tags/ifchanged.rb
locomotive_liquid-2.2.2 lib/liquid/tags/ifchanged.rb