Class: ThemeCheck::Tags::Section
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- ThemeCheck::Tags::Section
- Defined in:
- lib/theme_check/tags.rb
Overview
Copied tags parsing code from storefront-renderer
Constant Summary collapse
- SYNTAX =
/\A\s*(?<section_name>#{Liquid::QuotedString})\s*\z/o
Instance Attribute Summary collapse
-
#section_name ⇒ Object
readonly
Returns the value of attribute section_name.
Instance Method Summary collapse
-
#initialize(tag_name, markup, options) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(tag_name, markup, options) ⇒ Section
Returns a new instance of Section.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/theme_check/tags.rb', line 12 def initialize(tag_name, markup, ) super match = markup.match(SYNTAX) raise( Liquid::SyntaxError, "Error in tag 'section' - Valid syntax: section '[type]'", ) unless match @section_name = match[:section_name].tr(%('"), '') @section_name.chomp!(".liquid") if @section_name.end_with?(".liquid") end |
Instance Attribute Details
#section_name ⇒ Object (readonly)
Returns the value of attribute section_name.
10 11 12 |
# File 'lib/theme_check/tags.rb', line 10 def section_name @section_name end |