blob: 6fe0969ba764016117978fc4b459d6752087610d [file] [log] [blame]
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