Class: Twig::TwigTest
Instance Attribute Summary
Attributes inherited from Callable
#arguments, #callable, #dynamic_name, #name
Instance Method Summary
collapse
Methods inherited from Callable
#needs_charset?, #needs_environment?, #with_dynamic_arguments
Constructor Details
#initialize(name, callable = nil, options = {}) ⇒ TwigTest
Returns a new instance of TwigTest.
5
6
7
8
9
10
11
12
|
# File 'lib/twig/twig_test.rb', line 5
def initialize(name, callable = nil, options = {})
super
@options = {
node_class: Node::Expression::Test::Base,
one_mandatory_argument: false,
}.merge(@options)
end
|
Instance Method Details
#needs_context? ⇒ Boolean
27
28
29
|
# File 'lib/twig/twig_test.rb', line 27
def needs_context?
false
end
|
#node_class ⇒ Object
18
19
20
|
# File 'lib/twig/twig_test.rb', line 18
def node_class
@options[:node_class]
end
|
#one_mandatory_argument? ⇒ Boolean
23
24
25
|
# File 'lib/twig/twig_test.rb', line 23
def one_mandatory_argument?
@options[:one_mandatory_argument]
end
|
#type ⇒ Object
14
15
16
|
# File 'lib/twig/twig_test.rb', line 14
def type
:test
end
|