Module: ThemeCheck::ShopifyLiquid::Tag
Instance Method Summary collapse
Instance Method Details
#end_labels ⇒ Object
15 16 17 18 19 |
# File 'lib/theme_check/shopify_liquid/tag.rb', line 15 def end_labels @end_labels ||= .select { |x| x.is_a?(Hash) } .map { |x| x.values[0] } end |
#labels ⇒ Object
9 10 11 12 13 |
# File 'lib/theme_check/shopify_liquid/tag.rb', line 9 def labels @labels ||= .map { |x| to_label(x) } .to_set end |
#liquid_tag_regex(tag) ⇒ Object
27 28 29 30 31 |
# File 'lib/theme_check/shopify_liquid/tag.rb', line 27 def liquid_tag_regex(tag) return unless labels.include?(tag) @tag_liquid_regexes ||= {} @tag_liquid_regexes[tag] ||= /^\s*#{tag}/m end |
#tag_regex(tag) ⇒ Object
21 22 23 24 25 |
# File 'lib/theme_check/shopify_liquid/tag.rb', line 21 def tag_regex(tag) return unless labels.include?(tag) @tag_regexes ||= {} @tag_regexes[tag] ||= /\A#{Liquid::TagStart}-?\s*#{tag}/m end |