Class: Remap::Mapper::Or

Inherits:
Binary show all
Defined in:
lib/remap/mapper/or.rb

Constant Summary

Constants included from State

State::Schema

Instance Method Summary collapse

Methods inherited from Binary

#exception

Methods included from Operation

#call

Methods included from State

#state

Methods included from Operations

#&, #^, #|

Instance Method Details

#call!(state, &error) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/remap/mapper/or.rb', line 8

def call!(state, &error)
  unless error
    return call!(state, &exception)
  end

  left.call!(state) do |failure1|
    return right.call!(state) do |failure2|
      return error[failure1.merge(failure2)]
    end
  end
end