Class: Zwite::Liquid::Extends

Inherits:
Liquid::Block
  • Object
show all
Defined in:
lib/zwite/liquid/extends.rb

Constant Summary collapse

Syntax =
/(#{::Liquid::QuotedFragment})/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, markup, tokens) ⇒ Extends

Returns a new instance of Extends.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/zwite/liquid/extends.rb', line 10

def initialize(tag_name, markup, tokens)     
  if markup =~ Syntax 
    @template_name = $1
  else
    raise ::Liquid::SyntaxError.new("Syntax Error in 'extends' - Valid syntax: {% extends \"[template]\" %}")
  end

  case @template_name
  when /^'(.*)'$/
    @template_name = $1
  when /^"(.*)"$/
    @template_name = $1
  else
    raise ::Liquid::SyntaxError.new("Syntax Error in 'extends' - Valid syntax: {% extends \"[template]\" %}")
  end

  super

end

Instance Attribute Details

#template_nameObject

Returns the value of attribute template_name.



8
9
10
# File 'lib/zwite/liquid/extends.rb', line 8

def template_name
  @template_name
end

Instance Method Details

#assert_missing_delimitation!Object



30
31
32
# File 'lib/zwite/liquid/extends.rb', line 30

def assert_missing_delimitation!
  # we cannot have a missing delimination on the extends block
end