class Dry::Logic::Operations::Or

Public Instance Methods

[](input) click to toggle source
# File lib/dry/logic/operations/or.rb, line 28
def [](input)
  left[input] || right[input]
end
call(input) click to toggle source
# File lib/dry/logic/operations/or.rb, line 12
def call(input)
  left_result = left.(input)

  if left_result.success?
    Result::SUCCESS
  else
    right_result = right.(input)

    if right_result.success?
      Result::SUCCESS
    else
      Result.new(false, id) { [:or, [left_result.to_ast, right_result.to_ast]] }
    end
  end
end
operator()
Alias for: type
type() click to toggle source
# File lib/dry/logic/operations/or.rb, line 7
def type
  :or
end
Also aliased as: operator