Sha256: 14e1ce96b246fdeda4490163163caa968e5cb628ac955afa779025f95f2088ab

Contents?: true

Size: 360 Bytes

Versions: 12

Compression:

Stored size: 360 Bytes

Contents

module Liquid

  # Break tag to be used to break out of a for loop.
  #
  # == Basic Usage:
  #    {% for item in collection %}
  #      {% if item.condition %}
  #        {% break %}
  #      {% endif %}
  #    {% endfor %}
  #
  class Break < Tag

    def interrupt
      BreakInterrupt.new
    end

  end

  Template.register_tag('break'.freeze, Break)
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
locomotivecms-liquid-4.0.0 lib/liquid/tags/break.rb
liquid-3.0.6 lib/liquid/tags/break.rb
liquid-3.0.5 lib/liquid/tags/break.rb
liquid-3.0.4 lib/liquid/tags/break.rb
liquid-3.0.3 lib/liquid/tags/break.rb
liquid-3.0.2 lib/liquid/tags/break.rb
locomotivecms-liquid-4.0.0.alpha2 lib/liquid/tags/break.rb
locomotivecms-liquid-4.0.0.alpha1 lib/liquid/tags/break.rb
locomotivecms-liquid-4.0.0.alpha lib/liquid/tags/break.rb
liquid-3.0.1 lib/liquid/tags/break.rb
liquid-3.0.0 lib/liquid/tags/break.rb
liquid-3.0.0.rc1 lib/liquid/tags/break.rb