Class: Remap::Mapper::Or
- Inherits:
-
Binary
- Object
- Dry::Struct
- Struct
- Remap::Mapper
- Binary
- Remap::Mapper::Or
- Defined in:
- lib/remap/mapper/or.rb
Overview
Represents two mappers that are combined with the | operator
Instance Method Summary collapse
-
#call!(state) {|if| ... } ⇒ Result
Succeeds if left or right succeeds Returns which ever succeeds first.
Methods included from Operation
Methods included from Operations
Instance Method Details
#call!(state) {|if| ... } ⇒ Result
Succeeds if left or right succeeds Returns which ever succeeds first
35 36 37 38 39 40 41 |
# File 'lib/remap/mapper/or.rb', line 35 def call!(state, &error) left.call!(state) do |failure1| return right.call!(state) do |failure2| return error[failure1.merge(failure2)] end end end |