Module: Remap::Operation
- Included in:
- Base, Mapper::Binary
- Defined in:
- lib/remap/operation.rb
Overview
Instance Method Summary collapse
-
#call(input, **options) {|Failure| ... } ⇒ Success
Public interface for mappers.
Instance Method Details
#call(input, **options) {|Failure| ... } ⇒ Success
Public interface for mappers
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/remap/operation.rb', line 16 def call(input, **, &error) unless error return call(input, **) do |failure| raise failure.exception end end other = State.call(input, options: , mapper: self).then do |state| call!(state) do |failure| return error[failure] end end case other in { value: } value in { notices: [] } error[other.failure("No return value")] in { notices: } error[Failure.call(failures: notices)] end end |