Stash array of tag names in a constant

This commit is contained in:
Ashwin Maroli
2020-10-21 18:50:56 +05:30
parent c9ad9d338c
commit b15428ea83

View File

@@ -36,8 +36,11 @@ module Liquid
end
end
ELSE_TAG_NAMES = ['elsif', 'else'].freeze
private_constant :ELSE_TAG_NAMES
def unknown_tag(tag, markup, tokens)
if ['elsif', 'else'].include?(tag)
if ELSE_TAG_NAMES.include?(tag)
push_block(tag, markup)
else
super