Class: Twig::Node::Text
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
Constructor Details
#initialize(data, lineno = 0) ⇒ Text
Returns a new instance of Text.
8 9 10 |
# File 'lib/twig/node/text.rb', line 8 def initialize(data, lineno = 0) super({}, { data: }, lineno) end |
Instance Method Details
#compile(compiler) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/twig/node/text.rb', line 12 def compile(compiler) compiler. write('@output_buffer.safe_append = '). string(attributes[:data]). raw(";\n") end |