Class: FEEL::FunctionInvocation

Inherits:
Node
  • Object
show all
Defined in:
lib/feel/nodes.rb

Overview

  1. function invocation = expression , parameters ;

Instance Method Summary collapse

Methods inherited from Node

#qualified_names_in_context, #raise_evaluation_error

Instance Method Details

#eval(context = {}) ⇒ Object



442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/feel/nodes.rb', line 442

def eval(context = {})
  fn = context[fn_name.text_value.to_sym]

  unless fn
    raise_evaluation_error(fn_name.text_value, context) if FEEL.config.strict
    return nil
  end

  args = params.present? ? params.eval(context) : []

  fn.call(*args)
end