Class: Twig::Node::Expression::Test::Base

Inherits:
Call show all
Defined in:
lib/twig/node/expression/test/base.rb

Direct Known Subclasses

Constant, Defined, DivisibleBy, Even, Iterable, Mapping, Null, Odd, SameAs, Sequence

Instance Attribute Summary

Attributes inherited from Base

#attributes, #lineno, #nodes, #source_context, #tag

Instance Method Summary collapse

Methods inherited from Call

#compile

Methods inherited from Base

#explicit_parentheses?, #set_explicit_parentheses

Methods inherited from Base

#compile, #empty?, #length, #template_name, #to_s

Constructor Details

#initialize(node, test, arguments, lineno) ⇒ Base

Returns a new instance of Base.

Parameters:



12
13
14
15
16
17
18
19
20
21
# File 'lib/twig/node/expression/test/base.rb', line 12

def initialize(node, test, arguments, lineno)
  super({
    node:,
    arguments: arguments || Node::Empty.new,
  }, {
    name: test.name,
    type: :test,
    twig_callable: test,
  }, lineno)
end