Method: Layout#initialize

Defined in:
lib/tags/layout.rb

#initialize(tag_name, markup, tokens) ⇒ Layout

Returns a new instance of Layout.

Raises:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/tags/layout.rb', line 24

def initialize(tag_name, markup, tokens)
  super

  @page_content = []
  raise LayoutError, 'Invalid layout syntax' unless markup =~ SYNTAX

  layout_name = Regexp.last_match(1)
  @layout_name_expr = parse_expression(layout_name)
  @attributes = {}

  markup.scan(Liquid::TagAttributes) do |key, value|
    @attributes[key] = parse_expression(value)
  end
end