Class: Morpher::Transform::Sequence
- Inherits:
-
Morpher::Transform
- Object
- Morpher::Transform
- Morpher::Transform::Sequence
- Defined in:
- lib/morpher/transform.rb
Overview
Sequence of transformations
Instance Method Summary collapse
-
#call(input) ⇒ Either<Error, Object>
Apply transformation to input.
Methods inherited from Morpher::Transform
Instance Method Details
#call(input) ⇒ Either<Error, Object>
Apply transformation to input
427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/morpher/transform.rb', line 427 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: input)) end end success(current) end |