Module: FormulaDSL::FunctionExpressionFactory

Defined in:
lib/formula_dsl/function_expression_factory.rb

Class Method Summary collapse

Class Method Details

.new(function_name) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/formula_dsl/function_expression_factory.rb', line 9

def self.new(function_name)
  begin
    function = constantize("FormulaDSL::Functions::#{function_name.upcase}")

    function
  rescue(NameError)
    raise MissingFunctionError, "If you want to use the function #{function_name} you must implement that as a proc named FormulaDSL::Functions::#{function_name.upcase}"
  end
end