Class: ThemeCheck::Tags::Sections
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- ThemeCheck::Tags::Sections
- Defined in:
- lib/theme_check/tags.rb
Constant Summary collapse
- SYNTAX =
/\A\s*(?<sections_name>#{Liquid::QuotedString})\s*\z/o
Instance Attribute Summary collapse
-
#sections_name ⇒ Object
readonly
Returns the value of attribute sections_name.
Instance Method Summary collapse
-
#initialize(tag_name, markup, options) ⇒ Sections
constructor
A new instance of Sections.
Constructor Details
#initialize(tag_name, markup, options) ⇒ Sections
Returns a new instance of Sections.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/theme_check/tags.rb', line 30 def initialize(tag_name, markup, ) super match = markup.match(SYNTAX) raise( Liquid::SyntaxError, "Error in tag 'sections' - Valid syntax: sections '[type]'", ) unless match @sections_name = match[:sections_name].tr(%('"), '') @sections_name.chomp!(".liquid") if @sections_name.end_with?(".liquid") end |
Instance Attribute Details
#sections_name ⇒ Object (readonly)
Returns the value of attribute sections_name.
28 29 30 |
# File 'lib/theme_check/tags.rb', line 28 def sections_name @sections_name end |