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



415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/feel/nodes.rb', line 415

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