Class: Twig::Node::BlockReference
- 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
- #compile(compiler) ⇒ Object
-
#initialize(name, lineno) ⇒ BlockReference
constructor
A new instance of BlockReference.
Methods inherited from Base
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 |