Class: Twig::Node::BlockReference

Inherits:
Base
  • Object
show all
Defined in:
lib/twig/node/block_reference.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #lineno, #nodes, #source_context, #tag

Instance Method Summary collapse

Methods inherited from Base

#template_name

Constructor Details

#initialize(name, lineno) ⇒ BlockReference

Returns a new instance of BlockReference.



6
7
8
# File 'lib/twig/node/block_reference.rb', line 6

def initialize(name, lineno)
  super({}, { name: }, lineno)
end

Instance Method Details

#compile(compiler) ⇒ Object



10
11
12
13
14
# File 'lib/twig/node/block_reference.rb', line 10

def compile(compiler)
  compiler.
    write("yield_block(:#{attributes[:name]}, context, block_list.merge(blocks));").
    raw("\n")
end