Class: FlowEngine::Validation::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/flowengine/validation/adapter.rb

Overview

Abstract adapter for step-level validation. Implement #validate to plug in dry-validation, JSON Schema, or other validators; the engine does not depend on a specific one.

Direct Known Subclasses

NullAdapter

Instance Method Summary collapse

Instance Method Details

#validate(_node, _input) ⇒ Result

Validates the user's input for the given step.

Parameters:

  • _node (Node) —

    the current step (for schema/constraints)

  • _input (Object) —

    the value submitted by the user

Returns:

  • (Result) —

    valid: true/false and optional errors list

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/flowengine/validation/adapter.rb', line 33

def validate(_node, _input)
  raise NotImplementedError, "#{self.class}#validate must be implemented"
end