Class: Amrita2::Filters::FunctionFilter

Inherits:
Base show all
Defined in:
lib/amrita2/template.rb

Instance Attribute Summary

Attributes inherited from Base

#next_

Instance Method Summary collapse

Methods inherited from Base

filter_method, inherited, #parse_filter_a, #|

Constructor Details

#initialize(sym, *args) ⇒ FunctionFilter

Returns a new instance of FunctionFilter.



2448
2449
2450
# File 'lib/amrita2/template.rb', line 2448

def initialize(sym, *args)
  @sym, @args = sym, args
end

Instance Method Details

#value_filter_code(de, cg, element) ⇒ Object



2452
2453
2454
2455
# File 'lib/amrita2/template.rb', line 2452

def value_filter_code(de, cg, element)
  cg.code("$_ = $_.send(#{@sym.inspect}, *#{@args.inspect})")
  super
end