Class: ThemeCheck::Tags::Layout
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- ThemeCheck::Tags::Layout
- Defined in:
- lib/theme_check/tags.rb
Defined Under Namespace
Classes: ParseTreeVisitor
Constant Summary collapse
- SYNTAX =
/(?<layout>#{Liquid::QuotedFragment})/
- NO_LAYOUT_KEYS =
%w(false nil none).freeze
Instance Attribute Summary collapse
-
#layout_expr ⇒ Object
readonly
Returns the value of attribute layout_expr.
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ Layout
constructor
A new instance of Layout.
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ Layout
Returns a new instance of Layout.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/theme_check/tags.rb', line 123 def initialize(tag_name, markup, tokens) super match = markup.match(SYNTAX) raise( Liquid::SyntaxError, "in 'layout' - Valid syntax: layout (none|[layout_name])", ) unless match layout_markup = match[:layout] @layout_expr = if NO_LAYOUT_KEYS.include?(layout_markup.downcase) false else parse_expression(layout_markup) end end |
Instance Attribute Details
#layout_expr ⇒ Object (readonly)
Returns the value of attribute layout_expr.
121 122 123 |
# File 'lib/theme_check/tags.rb', line 121 def layout_expr @layout_expr end |