Class: Remap::Mapper::And
- Inherits:
-
Binary
- Object
- Dry::Struct
- Struct
- Remap::Mapper
- Binary
- Remap::Mapper::And
- Defined in:
- lib/remap/mapper/and.rb
Constant Summary
Constants included from State
Instance Method Summary collapse
Methods inherited from Binary
Methods included from Operation
Methods included from State
Methods included from Operations
Instance Method Details
#call!(state, &error) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/remap/mapper/and.rb', line 8 def call!(state, &error) unless error return call!(state, &exception) end state1 = left.call!(state) do |failure1| right.call!(state) do |failure2| return error[failure1.merge(failure2)] end return error[failure1] end state2 = right.call!(state) do |failure| return error[failure] end state1.merged(state2) end |