lib/dry/logic/rule.rb in dry-logic-1.2.0 vs lib/dry/logic/rule.rb in dry-logic-1.3.0
- old
+ new
@@ -1,13 +1,8 @@
# frozen_string_literal: true
require "concurrent/map"
-require "dry/core/constants"
-require "dry/core/equalizer"
-require "dry/logic/operations"
-require "dry/logic/result"
-require "dry/logic/rule/interface"
module Dry
module Logic
def self.Rule(*args, **options, &block)
if args.any?
@@ -76,10 +71,10 @@
)
end
end
def eval_args(object)
- with(args: args.map { |arg| UnboundMethod === arg ? arg.bind(object).() : arg })
+ with(args: args.map { |arg| arg.is_a?(UnboundMethod) ? arg.bind(object).() : arg })
end
def with(new_opts)
self.class.build(predicate, **options, **new_opts)
end