Method: Mutant::Transform::Sequence#call

Defined in:
lib/mutant/transform.rb

#call(input) ⇒ Either<Error, Object>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Apply transformation to input

Parameters:

  • (Object)

Returns:



411
412
413
414
415
416
417
418
419
420
421
# File 'lib/mutant/transform.rb', line 411

def call(input)
  current = input

  steps.each_with_index do |step, index|
    current = step.call(current).from_right do |error|
      return failure(error(cause: Index.wrap(error, index), input:))
    end
  end

  success(current)
end