Class: Twig::Node::Text
- Includes:
- Output
- Defined in:
- lib/twig/node/text.rb
Instance Attribute Summary
Attributes inherited from Base
#attributes, #lineno, #nodes, #source_context, #tag
Instance Method Summary collapse
- #compile(compiler) ⇒ Object
-
#initialize(data, lineno = 0) ⇒ Text
constructor
A new instance of Text.
Methods inherited from Base
#empty?, #length, #template_name, #to_s
Constructor Details
#initialize(data, lineno = 0) ⇒ Text
Returns a new instance of Text.
10 11 12 |
# File 'lib/twig/node/text.rb', line 10 def initialize(data, lineno = 0) super({}, { data: }, lineno) end |
Instance Method Details
#compile(compiler) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/twig/node/text.rb', line 14 def compile(compiler) compiler. add_debug_info(self). write('context.output_buffer.safe_append = '). string(attributes[:data]). raw(";\n") end |