lib/dry/logic/rule/check.rb in dry-logic-0.1.3 vs lib/dry/logic/rule/check.rb in dry-logic-0.1.4
- old
+ new
@@ -9,10 +9,17 @@
end
end
class Binary < Rule::Check
def evaluate_input(result)
- keys.map { |key| result[key].input }
+ keys.map do |key|
+ if key.is_a?(Hash)
+ parent, child = key.to_a.flatten
+ result[parent].input[child]
+ else
+ result[key].input
+ end
+ end
end
end
def initialize(name, predicate, keys)
super(name, predicate)