Class: Twig::Node::Capture
- Inherits:
-
Node::Base
- Object
- Node::Base
- Twig::Node::Capture
- Defined in:
- lib/twig/node/capture.rb
Instance Method Summary collapse
- #compile(compiler) ⇒ Object
-
#initialize(body, lineno) ⇒ Capture
constructor
A new instance of Capture.
Constructor Details
#initialize(body, lineno) ⇒ Capture
Returns a new instance of Capture.
8 9 10 |
# File 'lib/twig/node/capture.rb', line 8 def initialize(body, lineno) super({ body: }, { raw: false }, lineno) end |
Instance Method Details
#compile(compiler) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/twig/node/capture.rb', line 12 def compile(compiler) compiler. raw("context.buffer_and_return do\n"). indent. subcompile(nodes[:body]). outdent. write("end.to_s.html_safe\n") end |