class Morpher::Transform::Sequence
Sequence
of transformations
Public Instance Methods
call(input)
click to toggle source
Apply transformation to input
@param [Object]
@return [Either<Error, Object>]
# File lib/morpher/transform.rb, line 465 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
seq(transform)
click to toggle source
Build sequence
@param [Transform] transform
@return [Transform]
# File lib/morpher/transform.rb, line 456 def seq(transform) self.class.new(steps + [transform]) end