Exception: Synthra::Errors::MissingFunctionError

Inherits:
GenerationError show all
Defined in:
lib/synthra/errors.rb

Overview

Custom function not registered

Raised when a custom() type references a function that hasn't been registered with Synthra.register_function.

Examples:

# full_name: custom(:compute_name)
# MissingFunctionError: Custom function not registered: compute_name

Constant Summary collapse

ERROR_CODE =
"MISSING_FUNCTION_ERROR"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_name) ⇒ MissingFunctionError

Create a new MissingFunctionError

Parameters:

  • function_name (Symbol, String)

    the function name that wasn't registered



747
748
749
750
# File 'lib/synthra/errors.rb', line 747

def initialize(function_name)
  @function_name = function_name
  super("Custom function not registered: #{function_name}")
end

Instance Attribute Details

#function_nameSymbol (readonly)

Returns the function name that wasn't found.

Returns:

  • (Symbol)

    the function name that wasn't found



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/synthra/errors.rb', line 737

class MissingFunctionError < GenerationError
  ERROR_CODE = "MISSING_FUNCTION_ERROR"
  attr_reader :function_name


  # Create a new MissingFunctionError
  #
  # @param function_name [Symbol, String] the function name that wasn't registered
  #

  def initialize(function_name)
    @function_name = function_name
    super("Custom function not registered: #{function_name}")
  end
end