Liquid::Block
If is the conditional block
{% if user.admin %} Admin user! {% else %} Not admin user {% endif %} There are {% if count < 5 %} less {% else %} more {% endif %} items than you need.
# File lib/liquid/tags/if.rb, line 20 def initialize(tag_name, markup, tokens) @blocks = [] push_block('if', markup) super end
# File lib/liquid/tags/if.rb, line 36 def render(context) context.stack do @blocks.each do |block| if block.evaluate(context) return render_all(block.attachment, context) end end '' end end
# File lib/liquid/tags/if.rb, line 28 def unknown_tag(tag, markup, tokens) if ['elsif', 'else'].include?(tag) push_block(tag, markup) else super end end
[Validate]
Generated with the Darkfish Rdoc Generator 2.