Class: Twig::Node::Expression::Test::SameAs
- Defined in:
- lib/twig/node/expression/test/same_as.rb
Overview
Checks if a variable is the same as another.
{{ var is same as(other) }}
Instance Attribute Summary
Attributes inherited from Base
#attributes, #lineno, #nodes, #source_context, #tag
Instance Method Summary collapse
Methods inherited from Base
Methods inherited from Base
#explicit_parentheses?, #set_explicit_parentheses
Methods inherited from Base
#empty?, #initialize, #length, #template_name, #to_s
Constructor Details
This class inherits a constructor from Twig::Node::Expression::Test::Base
Instance Method Details
#compile(compiler) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/twig/node/expression/test/same_as.rb', line 11 def compile(compiler) compiler. raw('('). subcompile(nodes[:node]). raw(' == '). subcompile(nodes[:arguments].nodes[0]). raw(')') end |