class Dry::Schema::Step
@api private
def call(result)
- Api: - private
def call(result) scoped_result = path.equal?(Path::EMPTY) ? result : result.at(path) output = executor.(scoped_result) scoped_result.replace(output) if output.is_a?(Hash) output end
def initialize(type:, name:, executor:, path: Path::EMPTY)
- Api: - private
def initialize(type:, name:, executor:, path: Path::EMPTY) @type = type @name = name @executor = executor @path = path validate_name(name) end
def scoped(parent_path)
- Api: - private
def scoped(parent_path) self.class.new( type: type, name: name, executor: executor, path: Path.new([*parent_path, *path]) ) end
def validate_name(name)
- Api: - private
def validate_name(name) return if STEPS_IN_ORDER.include?(name) raise ArgumentError, "Undefined step name #{name}. Available names: #{STEPS_IN_ORDER}" end