Class: Remap::Mapper::Xor
- Inherits:
-
Binary
- Object
- Dry::Struct
- Struct
- Remap::Mapper
- Binary
- Remap::Mapper::Xor
- Defined in:
- lib/remap/mapper/xor.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 |
# File 'lib/remap/mapper/xor.rb', line 8 def call!(state, &error) unless error return call!(state, &exception) end state1 = left.call!(state) do |failure1| return right.call!(state) do |failure2| return error[failure1.merge(failure2)] end end state2 = right.call!(state) do return state1 end error[state1.merged(state2).failure("Both left and right passed in xor")] end |