Class: Twig::Node::Expression::Filter::Raw
- Inherits:
-
Twig::Node::Expression::Filter
- Object
- Base
- Base
- Call
- Twig::Node::Expression::Filter
- Twig::Node::Expression::Filter::Raw
- Defined in:
- lib/twig/node/expression/filter/raw.rb
Instance Attribute Summary
Attributes inherited from Base
#attributes, #lineno, #nodes, #source_context, #tag
Instance Method Summary collapse
- #compile(compiler) ⇒ Object
-
#initialize(node, filter = nil, arguments = nil, lineno = nil) ⇒ Raw
constructor
A new instance of Raw.
Methods inherited from Base
#explicit_parentheses?, #set_explicit_parentheses
Methods inherited from Base
#empty?, #length, #template_name, #to_s
Constructor Details
#initialize(node, filter = nil, arguments = nil, lineno = nil) ⇒ Raw
Returns a new instance of Raw.
12 13 14 15 16 17 18 19 |
# File 'lib/twig/node/expression/filter/raw.rb', line 12 def initialize(node, filter = nil, arguments = nil, lineno = nil) super( node, filter || TwigFilter.new('raw', nil, { is_safe: [:all] }), arguments || Node::Empty.new, lineno || node.lineno ) end |
Instance Method Details
#compile(compiler) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/twig/node/expression/filter/raw.rb', line 21 def compile(compiler) compiler. raw('((tmp = '). subcompile(nodes[:node]). raw(').respond_to?(:html_safe) ? tmp.html_safe : tmp)') end |