Class: Twig::Callable

Inherits:
Object
  • Object
show all
Defined in:
lib/twig/callable.rb

Direct Known Subclasses

TwigFilter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, callable = nil, options = {}) ⇒ Callable



10
11
12
13
14
15
16
17
18
19
# File 'lib/twig/callable.rb', line 10

def initialize(name, callable = nil, options = {})
  @name = @dynamic_name = name
  @callable = callable
  @options = {
    needs_environment: false,
    needs_context: false,
    needs_charset: false,
    is_variadic: false,
  }.merge(options)
end

Instance Attribute Details

#callableObject (readonly)

Returns the value of attribute callable.



5
6
7
# File 'lib/twig/callable.rb', line 5

def callable
  @callable
end

#dynamic_nameObject (readonly)

Returns the value of attribute dynamic_name.



5
6
7
# File 'lib/twig/callable.rb', line 5

def dynamic_name
  @dynamic_name
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/twig/callable.rb', line 5

def name
  @name
end