lib/dry/logic/operations/set.rb in dry-logic-1.2.0 vs lib/dry/logic/operations/set.rb in dry-logic-1.3.0
- old
+ new
@@ -1,10 +1,7 @@
# frozen_string_literal: true
-require "dry/logic/operations/abstract"
-require "dry/logic/result"
-
module Dry
module Logic
module Operations
class Set < Abstract
def type
@@ -14,10 +11,10 @@
def call(input)
results = rules.map { |rule| rule.(input) }
success = results.all?(&:success?)
Result.new(success, id) do
- [type, results.select(&:failure?).map { |failure| failure.to_ast }]
+ [type, results.select(&:failure?).map(&:to_ast)]
end
end
def [](input)
rules.map { |rule| rule[input] }.all?