24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/remap/mapper/support/api.rb', line 24
def call(input, backtrace: caller, **options, &error)
unless error
return call(input, **options) do |failure|
raise failure.exception(backtrace)
end
end
s0 = State.call(input, options: options, mapper: self)._
s1 = call!(s0) do |failure|
return error[failure]
end
case s1
in { value: value }
value
in { notices: [] }
error[s1.failure("No data could be mapped")]
in { notices: }
error[Failure.new(failures: notices)]
end
end
|