Class: SpecForge::Error::InvalidTransformFunctionError

Inherits:
Error
  • Object
show all
Defined in:
lib/spec_forge/error.rb

Overview

Raised when an unknown transform function is referenced Indicates when a transform name isn't supported

Instance Method Summary collapse

Constructor Details

#initialize(input, valid_functions) ⇒ InvalidTransformFunctionError

Returns a new instance of InvalidTransformFunctionError.



66
67
68
69
70
71
72
73
74
75
# File 'lib/spec_forge/error.rb', line 66

def initialize(input, valid_functions)
  formatted_functions = valid_functions.join_map(", ") { |f| "transform.#{f}".in_quotes }

  super(<<~STRING.chomp
    Undefined transform function "#{input}".

    Valid functions: #{formatted_functions}
  STRING
  )
end