Class: Mutant::Transform::Sequence Private

Inherits:
Mutant::Transform show all
Defined in:
lib/mutant/transform.rb

Overview

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

Sequence of transformations

Instance Method Summary collapse

Methods inherited from Mutant::Transform

#slug

Instance Method Details

#apply(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

ignore :reek:NestedIterators

Parameters:

  • (Object)

Returns:



483
484
485
486
487
488
489
490
491
492
493
# File 'lib/mutant/transform.rb', line 483

def apply(input)
  current = input

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

  success(current)
end